command start and end injector

pull/310/head
Frostebite 2021-12-29 17:04:06 +00:00
parent d2c92576f0
commit 178956ad5d
4 changed files with 14 additions and 10 deletions

9
dist/index.js vendored
View File

@ -2418,10 +2418,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CloudRunnerBuildCommandProcessor = void 0;
class CloudRunnerBuildCommandProcessor {
static ProcessCommands(commands) {
return `
echo "start"
${commands}
echo "end"`;
return `echo "---"
echo "start"
${commands}
echo "end"
`;
}
}
exports.CloudRunnerBuildCommandProcessor = CloudRunnerBuildCommandProcessor;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,9 @@ describe('Cloud Runner', () => {
buildParameter.logToFile = true;
const baseImage = new ImageTag(buildParameter);
await CloudRunner.run(buildParameter, baseImage.toString());
const file = fs.readFileSync(`${CloudRunnerState.buildGuid}-outputfile.txt`, 'utf-8').toString();
const testOutput = `${CloudRunnerState.buildGuid}-outputfile.txt`;
expect(fs.existsSync(testOutput)).toBeTruthy();
const file = fs.readFileSync(testOutput, 'utf-8').toString();
expect(file).toContain(JSON.stringify(buildParameter));
expect(file).toContain(`${testSecretName}=${testSecretValue}`);
const inputKeys = Object.getOwnPropertyNames(Input);

View File

@ -1,8 +1,9 @@
export class CloudRunnerBuildCommandProcessor {
public static ProcessCommands(commands: string): string {
return `
echo "start"
${commands}
echo "end"`;
return `echo "---"
echo "start"
${commands}
echo "end"
`;
}
}