cleanup logging

pull/479/head
Frostebite 2022-12-09 20:27:58 +00:00
parent 639a300112
commit 78a1e42e0a
4 changed files with 15 additions and 13 deletions

14
dist/index.js vendored
View File

@ -4346,7 +4346,7 @@ const remote_client_logger_1 = __nccwpck_require__(59412);
const path_1 = __importDefault(__nccwpck_require__(71017)); const path_1 = __importDefault(__nccwpck_require__(71017));
const cloud_runner_options_1 = __importDefault(__nccwpck_require__(96552)); const cloud_runner_options_1 = __importDefault(__nccwpck_require__(96552));
const fs = __importStar(__nccwpck_require__(57147)); const fs = __importStar(__nccwpck_require__(57147));
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855)); // import CloudRunnerLogger from './cloud-runner-logger';
class CloudRunnerCustomHooks { class CloudRunnerCustomHooks {
// TODO also accept hooks as yaml files in the repo // TODO also accept hooks as yaml files in the repo
static ApplyHooksToCommands(commands, buildParameters) { static ApplyHooksToCommands(commands, buildParameters) {
@ -4415,7 +4415,7 @@ class CloudRunnerCustomHooks {
return []; return [];
} }
// if (CloudRunner.buildParameters?.cloudRunnerIntegrationTests) { // if (CloudRunner.buildParameters?.cloudRunnerIntegrationTests) {
cloud_runner_logger_1.default.log(`Parsing build hooks: ${steps}`); // CloudRunnerLogger.log(`Parsing build hooks: ${steps}`);
// } // }
const isArray = steps.replace(/\s/g, ``)[0] === `-`; const isArray = steps.replace(/\s/g, ``)[0] === `-`;
const object = isArray ? yaml_1.default.parse(steps) : [yaml_1.default.parse(steps)]; const object = isArray ? yaml_1.default.parse(steps) : [yaml_1.default.parse(steps)];
@ -4659,7 +4659,7 @@ class CloudRunnerCustomSteps {
}); });
} }
static ParseSteps(steps) { static ParseSteps(steps) {
var _a, _b; var _a;
if (steps === '') { if (steps === '') {
return []; return [];
} }
@ -4667,9 +4667,9 @@ class CloudRunnerCustomSteps {
// CloudRunnerLogger.log(`Parsing build steps: ${steps}`); // CloudRunnerLogger.log(`Parsing build steps: ${steps}`);
// } // }
const isArray = steps.replace(/\s/g, ``)[0] === `-`; const isArray = steps.replace(/\s/g, ``)[0] === `-`;
if ((_a = cloud_runner_1.default.buildParameters) === null || _a === void 0 ? void 0 : _a.cloudRunnerDebug) { // if (CloudRunner.buildParameters?.cloudRunnerDebug) {
cloud_runner_logger_1.default.log(`Parsing: ${steps}`); // CloudRunnerLogger.log(`Parsing: ${steps}`);
} // }
const object = isArray ? yaml_1.default.parse(steps) : [yaml_1.default.parse(steps)]; const object = isArray ? yaml_1.default.parse(steps) : [yaml_1.default.parse(steps)];
for (const step of object) { for (const step of object) {
CloudRunnerCustomSteps.ConvertYamlSecrets(step); CloudRunnerCustomSteps.ConvertYamlSecrets(step);
@ -4679,7 +4679,7 @@ class CloudRunnerCustomSteps {
else { else {
for (const secret of step.secrets) { for (const secret of step.secrets) {
if (secret.ParameterValue === undefined && process.env[secret.EnvironmentVariable] !== undefined) { if (secret.ParameterValue === undefined && process.env[secret.EnvironmentVariable] !== undefined) {
if ((_b = cloud_runner_1.default.buildParameters) === null || _b === void 0 ? void 0 : _b.cloudRunnerDebug) { if ((_a = cloud_runner_1.default.buildParameters) === null || _a === void 0 ? void 0 : _a.cloudRunnerDebug) {
cloud_runner_logger_1.default.log(`Injecting custom step ${step.name} from env var ${secret.ParameterKey}`); cloud_runner_logger_1.default.log(`Injecting custom step ${step.name} from env var ${secret.ParameterKey}`);
} }
secret.ParameterValue = process.env[secret.ParameterKey] || ``; secret.ParameterValue = process.env[secret.ParameterKey] || ``;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,8 @@ import { RemoteClientLogger } from '../remote-client/remote-client-logger';
import path from 'path'; import path from 'path';
import CloudRunnerOptions from '../cloud-runner-options'; import CloudRunnerOptions from '../cloud-runner-options';
import * as fs from 'fs'; import * as fs from 'fs';
import CloudRunnerLogger from './cloud-runner-logger';
// import CloudRunnerLogger from './cloud-runner-logger';
export class CloudRunnerCustomHooks { export class CloudRunnerCustomHooks {
// TODO also accept hooks as yaml files in the repo // TODO also accept hooks as yaml files in the repo
@ -83,7 +84,7 @@ export class CloudRunnerCustomHooks {
// if (CloudRunner.buildParameters?.cloudRunnerIntegrationTests) { // if (CloudRunner.buildParameters?.cloudRunnerIntegrationTests) {
CloudRunnerLogger.log(`Parsing build hooks: ${steps}`); // CloudRunnerLogger.log(`Parsing build hooks: ${steps}`);
// } // }
const isArray = steps.replace(/\s/g, ``)[0] === `-`; const isArray = steps.replace(/\s/g, ``)[0] === `-`;

View File

@ -192,9 +192,10 @@ export class CloudRunnerCustomSteps {
// } // }
const isArray = steps.replace(/\s/g, ``)[0] === `-`; const isArray = steps.replace(/\s/g, ``)[0] === `-`;
if (CloudRunner.buildParameters?.cloudRunnerDebug) {
CloudRunnerLogger.log(`Parsing: ${steps}`); // if (CloudRunner.buildParameters?.cloudRunnerDebug) {
} // CloudRunnerLogger.log(`Parsing: ${steps}`);
// }
const object: CustomStep[] = isArray ? YAML.parse(steps) : [YAML.parse(steps)]; const object: CustomStep[] = isArray ? YAML.parse(steps) : [YAML.parse(steps)];
for (const step of object) { for (const step of object) {
CloudRunnerCustomSteps.ConvertYamlSecrets(step); CloudRunnerCustomSteps.ConvertYamlSecrets(step);