Simple retained workspace check exploration and stubbing post build steps as a CLI command
parent
17e652cb49
commit
aca6752ecd
|
|
@ -566,6 +566,28 @@ class Cli {
|
||||||
return yield __1.CloudRunner.run(buildParameter, baseImage.toString());
|
return yield __1.CloudRunner.run(buildParameter, baseImage.toString());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
static PostCLIBuild() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
/*
|
||||||
|
# LIBRARY CACHE
|
||||||
|
node ${builderPath} -m cache-push --cachePushFrom ${CloudRunnerFolders.ToLinuxFolder(
|
||||||
|
CloudRunnerFolders.libraryFolderAbsolute,
|
||||||
|
)} --artifactName lib-${guid} --cachePushTo ${CloudRunnerFolders.ToLinuxFolder(`${linuxCacheFolder}/Library`)}
|
||||||
|
|
||||||
|
echo "game ci cloud runner push build to cache"
|
||||||
|
|
||||||
|
# BUILD CACHE
|
||||||
|
node ${builderPath} -m cache-push --cachePushFrom ${CloudRunnerFolders.ToLinuxFolder(
|
||||||
|
CloudRunnerFolders.projectBuildFolderAbsolute,
|
||||||
|
)} --artifactName build-${guid} --cachePushTo ${`${CloudRunnerFolders.ToLinuxFolder(`${linuxCacheFolder}/build`)}`}
|
||||||
|
|
||||||
|
# RETAINED WORKSPACE CLEANUP
|
||||||
|
${BuildAutomationWorkflow.GetCleanupCommand(CloudRunnerFolders.projectPathAbsolute)}`;
|
||||||
|
*/
|
||||||
|
core.info(`Running POST build tasks`);
|
||||||
|
return new Promise((result) => result(``));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
__decorate([
|
__decorate([
|
||||||
cli_functions_repository_1.CliFunction(`print-input`, `prints all input`)
|
cli_functions_repository_1.CliFunction(`print-input`, `prints all input`)
|
||||||
|
|
@ -573,6 +595,9 @@ __decorate([
|
||||||
__decorate([
|
__decorate([
|
||||||
cli_functions_repository_1.CliFunction(`cli`, `runs a cloud runner build`)
|
cli_functions_repository_1.CliFunction(`cli`, `runs a cloud runner build`)
|
||||||
], Cli, "CLIBuild", null);
|
], Cli, "CLIBuild", null);
|
||||||
|
__decorate([
|
||||||
|
cli_functions_repository_1.CliFunction(`remote-cli-post-build`, `runs a cloud runner build`)
|
||||||
|
], Cli, "PostCLIBuild", null);
|
||||||
exports.Cli = Cli;
|
exports.Cli = Cli;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -5099,6 +5124,7 @@ class BuildAutomationWorkflow {
|
||||||
/entrypoint.sh
|
/entrypoint.sh
|
||||||
echo "game ci cloud runner push library to cache"
|
echo "game ci cloud runner push library to cache"
|
||||||
chmod +x ${builderPath}
|
chmod +x ${builderPath}
|
||||||
|
node ${builderPath} -m remote-cli-post-build
|
||||||
node ${builderPath} -m cache-push --cachePushFrom ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.libraryFolderAbsolute)} --artifactName lib-${guid} --cachePushTo ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(`${linuxCacheFolder}/Library`)}
|
node ${builderPath} -m cache-push --cachePushFrom ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.libraryFolderAbsolute)} --artifactName lib-${guid} --cachePushTo ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(`${linuxCacheFolder}/Library`)}
|
||||||
echo "game ci cloud runner push build to cache"
|
echo "game ci cloud runner push build to cache"
|
||||||
node ${builderPath} -m cache-push --cachePushFrom ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.projectBuildFolderAbsolute)} --artifactName build-${guid} --cachePushTo ${`${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(`${linuxCacheFolder}/build`)}`}
|
node ${builderPath} -m cache-push --cachePushFrom ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.projectBuildFolderAbsolute)} --artifactName build-${guid} --cachePushTo ${`${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(`${linuxCacheFolder}/build`)}`}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -107,4 +107,27 @@ export class Cli {
|
||||||
|
|
||||||
return await CloudRunner.run(buildParameter, baseImage.toString());
|
return await CloudRunner.run(buildParameter, baseImage.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CliFunction(`remote-cli-post-build`, `runs a cloud runner build`)
|
||||||
|
public static async PostCLIBuild(): Promise<string> {
|
||||||
|
/*
|
||||||
|
# LIBRARY CACHE
|
||||||
|
node ${builderPath} -m cache-push --cachePushFrom ${CloudRunnerFolders.ToLinuxFolder(
|
||||||
|
CloudRunnerFolders.libraryFolderAbsolute,
|
||||||
|
)} --artifactName lib-${guid} --cachePushTo ${CloudRunnerFolders.ToLinuxFolder(`${linuxCacheFolder}/Library`)}
|
||||||
|
|
||||||
|
echo "game ci cloud runner push build to cache"
|
||||||
|
|
||||||
|
# BUILD CACHE
|
||||||
|
node ${builderPath} -m cache-push --cachePushFrom ${CloudRunnerFolders.ToLinuxFolder(
|
||||||
|
CloudRunnerFolders.projectBuildFolderAbsolute,
|
||||||
|
)} --artifactName build-${guid} --cachePushTo ${`${CloudRunnerFolders.ToLinuxFolder(`${linuxCacheFolder}/build`)}`}
|
||||||
|
|
||||||
|
# RETAINED WORKSPACE CLEANUP
|
||||||
|
${BuildAutomationWorkflow.GetCleanupCommand(CloudRunnerFolders.projectPathAbsolute)}`;
|
||||||
|
*/
|
||||||
|
core.info(`Running POST build tasks`);
|
||||||
|
|
||||||
|
return new Promise((result) => result(``));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ describe('Cloud Runner Retain Workspace', () => {
|
||||||
CloudRunnerLogger.log(`run 2 succeeded`);
|
CloudRunnerLogger.log(`run 2 succeeded`);
|
||||||
|
|
||||||
const build2ContainsCacheKey = results2.includes(buildParameter.cacheKey);
|
const build2ContainsCacheKey = results2.includes(buildParameter.cacheKey);
|
||||||
|
const build2ContainsBuildGuid1FromRetainedWorkspace = results2.includes(buildParameter.buildGuid);
|
||||||
const build2ContainsBuildSucceeded = results2.includes(buildSucceededString);
|
const build2ContainsBuildSucceeded = results2.includes(buildSucceededString);
|
||||||
const build2NotContainsNoLibraryMessage = !results2.includes(libraryString);
|
const build2NotContainsNoLibraryMessage = !results2.includes(libraryString);
|
||||||
const build2NotContainsZeroLibraryCacheFilesMessage = !results2.includes(
|
const build2NotContainsZeroLibraryCacheFilesMessage = !results2.includes(
|
||||||
|
|
@ -60,6 +61,7 @@ describe('Cloud Runner Retain Workspace', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(build2ContainsCacheKey).toBeTruthy();
|
expect(build2ContainsCacheKey).toBeTruthy();
|
||||||
|
expect(build2ContainsBuildGuid1FromRetainedWorkspace).toBeTruthy();
|
||||||
expect(build2ContainsBuildSucceeded).toBeTruthy();
|
expect(build2ContainsBuildSucceeded).toBeTruthy();
|
||||||
expect(build2NotContainsZeroLibraryCacheFilesMessage).toBeTruthy();
|
expect(build2NotContainsZeroLibraryCacheFilesMessage).toBeTruthy();
|
||||||
expect(build2NotContainsZeroLFSCacheFilesMessage).toBeTruthy();
|
expect(build2NotContainsZeroLFSCacheFilesMessage).toBeTruthy();
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,7 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
||||||
/entrypoint.sh
|
/entrypoint.sh
|
||||||
echo "game ci cloud runner push library to cache"
|
echo "game ci cloud runner push library to cache"
|
||||||
chmod +x ${builderPath}
|
chmod +x ${builderPath}
|
||||||
|
node ${builderPath} -m remote-cli-post-build
|
||||||
node ${builderPath} -m cache-push --cachePushFrom ${CloudRunnerFolders.ToLinuxFolder(
|
node ${builderPath} -m cache-push --cachePushFrom ${CloudRunnerFolders.ToLinuxFolder(
|
||||||
CloudRunnerFolders.libraryFolderAbsolute,
|
CloudRunnerFolders.libraryFolderAbsolute,
|
||||||
)} --artifactName lib-${guid} --cachePushTo ${CloudRunnerFolders.ToLinuxFolder(`${linuxCacheFolder}/Library`)}
|
)} --artifactName lib-${guid} --cachePushTo ${CloudRunnerFolders.ToLinuxFolder(`${linuxCacheFolder}/Library`)}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue