Cherry pick try-catch block to output results if build is failing

pull/90/head
Vladimir Kryukov 2021-01-17 13:42:25 +02:00
parent e1be8325cd
commit db6745d25f
2 changed files with 18 additions and 16 deletions

File diff suppressed because one or more lines are too long

View File

@ -16,22 +16,24 @@ async function action() {
} = Input.getFromUser();
const baseImage = ImageTag.createForBase({ version: unityVersion, customImage });
// Build docker image
const actionImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
try {
// Build docker image
const actionImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
// Run docker image
await Docker.run(actionImage, {
workspace,
unityVersion,
projectPath,
testMode,
artifactsPath,
useHostNetwork,
customParameters,
});
// Set output
await Output.setArtifactsPath(artifactsPath);
// Run docker image
await Docker.run(actionImage, {
workspace,
unityVersion,
projectPath,
testMode,
artifactsPath,
useHostNetwork,
customParameters,
});
} finally {
// Set output
await Output.setArtifactsPath(artifactsPath);
}
}
action().catch(error => {