pipeline improvements
parent
ffeb59ea3d
commit
d3aa926ba3
|
@ -4723,18 +4723,17 @@ const cloud_runner_options_1 = __importDefault(__nccwpck_require__(96552));
|
|||
const fs = __importStar(__nccwpck_require__(57147));
|
||||
// import CloudRunnerLogger from './cloud-runner-logger';
|
||||
class CloudRunnerCustomHooks {
|
||||
// TODO also accept hooks as yaml files in the repo
|
||||
static ApplyHooksToCommands(commands, buildParameters) {
|
||||
const hooks = CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks);
|
||||
return `echo "---"
|
||||
echo "start cloud runner init"
|
||||
${cloud_runner_options_1.default.cloudRunnerDebugEnv ? `printenv` : `#`}
|
||||
echo "start of cloud runner job"
|
||||
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
||||
${commands}
|
||||
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
|
||||
echo "end of cloud runner job"
|
||||
echo "---${buildParameters.logId}"`;
|
||||
echo "start cloud runner init"
|
||||
${cloud_runner_options_1.default.cloudRunnerDebugEnv ? `printenv` : `#`}
|
||||
echo "start of cloud runner job"
|
||||
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
||||
${commands}
|
||||
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
|
||||
echo "end of cloud runner job"
|
||||
echo "---${buildParameters.logId}"`;
|
||||
}
|
||||
static getHooks(customJobHooks) {
|
||||
const experimentHooks = customJobHooks;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9,19 +9,18 @@ import * as fs from 'fs';
|
|||
// import CloudRunnerLogger from './cloud-runner-logger';
|
||||
|
||||
export class CloudRunnerCustomHooks {
|
||||
// TODO also accept hooks as yaml files in the repo
|
||||
public static ApplyHooksToCommands(commands: string, buildParameters: BuildParameters): string {
|
||||
const hooks = CloudRunnerCustomHooks.getHooks(buildParameters.customJobHooks);
|
||||
|
||||
return `echo "---"
|
||||
echo "start cloud runner init"
|
||||
${CloudRunnerOptions.cloudRunnerDebugEnv ? `printenv` : `#`}
|
||||
echo "start of cloud runner job"
|
||||
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
||||
${commands}
|
||||
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
|
||||
echo "end of cloud runner job"
|
||||
echo "---${buildParameters.logId}"`;
|
||||
echo "start cloud runner init"
|
||||
${CloudRunnerOptions.cloudRunnerDebugEnv ? `printenv` : `#`}
|
||||
echo "start of cloud runner job"
|
||||
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
||||
${commands}
|
||||
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
|
||||
echo "end of cloud runner job"
|
||||
echo "---${buildParameters.logId}"`;
|
||||
}
|
||||
|
||||
public static getHooks(customJobHooks): Hook[] {
|
||||
|
|
Loading…
Reference in New Issue