use the same builder path folders for build step as setup step

pull/273/head
Frostebite 2021-07-31 23:06:31 +01:00
parent 34b62aa849
commit 848cc03ba7
3 changed files with 21 additions and 20 deletions

18
dist/index.js vendored
View File

@ -2090,6 +2090,7 @@ const kubernetes_build_platform_1 = __importDefault(__webpack_require__(81730));
const repositoryFolder = 'repo';
const buildVolumeFolder = 'data';
const cacheFolder = 'cache';
const cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}`;
class RemoteBuilder {
static build(buildParameters, baseImage) {
var _a;
@ -2159,7 +2160,7 @@ class RemoteBuilder {
const repo3 = `https://${buildParameters.githubToken}@github.com/${process.env.GITHUB_REPOSITORY}.git`;
const purgeRemoteCache = process.env.PURGE_REMOTE_BUILDER_CACHE === undefined;
const initializeSourceRepoForCaching = `${this.builderPathFull}/dist/remote-builder/cloneNoLFS.sh ${this.repoPathFull} ${repo3} $GITHUB_SHA ${testLFSFile}`;
const handleCaching = `${this.builderPathFull}/dist/remote-builder/handleCaching.sh ${this.cacheFolderFull} ${branchName} ${this.libraryFolderFull} ${lfsDirectory} ${purgeRemoteCache}`;
const handleCaching = `${this.builderPathFull}/dist/remote-builder/handleCaching.sh ${cacheFolderFull} ${branchName} ${this.libraryFolderFull} ${lfsDirectory} ${purgeRemoteCache}`;
yield this.RemoteBuilderProviderPlatform.runBuildTask(buildUid, 'alpine/git', [
` apk update -q
apk add unzip -q
@ -2253,14 +2254,14 @@ class RemoteBuilder {
core.info('Starting part 2/4 (build unity project)');
yield this.RemoteBuilderProviderPlatform.runBuildTask(buildUid, baseImage.toString(), [
`
cp -r /${buildVolumeFolder}/${buildUid}/builder/dist/default-build-script/ /UnityBuilderAction;
cp -r /${buildVolumeFolder}/${buildUid}/builder/dist/entrypoint.sh /entrypoint.sh;
cp -r /${buildVolumeFolder}/${buildUid}/builder/dist/steps/ /steps;
chmod -R +x /entrypoint.sh;
chmod -R +x /steps;
/entrypoint.sh;
cp -r "${this.builderPathFull}/dist/default-build-script/" "/UnityBuilderAction"
cp -r "${this.builderPathFull}/dist/entrypoint.sh" "/entrypoint.sh"
cp -r "${this.builderPathFull}/dist/steps/" "/steps"
chmod -R +x "/entrypoint.sh"
chmod -R +x "/steps"
/entrypoint.sh
`,
], `/${buildVolumeFolder}`, `/${buildVolumeFolder}/${buildUid}/${repositoryFolder}/`, [
], `/${buildVolumeFolder}`, `/${this.repoPathFull}`, [
{
name: 'ContainerMemory',
value: buildParameters.remoteBuildMemory,
@ -2433,7 +2434,6 @@ class RemoteBuilder {
}
}
RemoteBuilder.SteamDeploy = false;
RemoteBuilder.cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}`;
exports.default = RemoteBuilder;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -8,11 +8,12 @@ import Kubernetes from './kubernetes-build-platform';
const repositoryFolder = 'repo';
const buildVolumeFolder = 'data';
const cacheFolder = 'cache';
const cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}`;
class RemoteBuilder {
static SteamDeploy: boolean = false;
private static cacheFolderFull: string = `/${buildVolumeFolder}/${cacheFolder}`;
private static readonly remoteBuilderUtilityRepoFolder: string;
private static readonly remoteBuilderSteamUtilityRepoFolder: string;
private static buildPathFull: string;
private static builderPathFull: string;
private static steamPathFull: string;
@ -113,7 +114,7 @@ class RemoteBuilder {
const purgeRemoteCache = process.env.PURGE_REMOTE_BUILDER_CACHE === undefined;
const initializeSourceRepoForCaching = `${this.builderPathFull}/dist/remote-builder/cloneNoLFS.sh ${this.repoPathFull} ${repo3} $GITHUB_SHA ${testLFSFile}`;
const handleCaching = `${this.builderPathFull}/dist/remote-builder/handleCaching.sh ${this.cacheFolderFull} ${branchName} ${this.libraryFolderFull} ${lfsDirectory} ${purgeRemoteCache}`;
const handleCaching = `${this.builderPathFull}/dist/remote-builder/handleCaching.sh ${cacheFolderFull} ${branchName} ${this.libraryFolderFull} ${lfsDirectory} ${purgeRemoteCache}`;
await this.RemoteBuilderProviderPlatform.runBuildTask(
buildUid,
'alpine/git',
@ -230,16 +231,16 @@ class RemoteBuilder {
baseImage.toString(),
[
`
cp -r /${buildVolumeFolder}/${buildUid}/builder/dist/default-build-script/ /UnityBuilderAction;
cp -r /${buildVolumeFolder}/${buildUid}/builder/dist/entrypoint.sh /entrypoint.sh;
cp -r /${buildVolumeFolder}/${buildUid}/builder/dist/steps/ /steps;
chmod -R +x /entrypoint.sh;
chmod -R +x /steps;
/entrypoint.sh;
cp -r "${this.builderPathFull}/dist/default-build-script/" "/UnityBuilderAction"
cp -r "${this.builderPathFull}/dist/entrypoint.sh" "/entrypoint.sh"
cp -r "${this.builderPathFull}/dist/steps/" "/steps"
chmod -R +x "/entrypoint.sh"
chmod -R +x "/steps"
/entrypoint.sh
`,
],
`/${buildVolumeFolder}`,
`/${buildVolumeFolder}/${buildUid}/${repositoryFolder}/`,
`/${this.repoPathFull}`,
[
{
name: 'ContainerMemory',