fix
parent
8918f23f05
commit
7fbd0c1297
|
|
@ -2179,10 +2179,10 @@ class RemoteBuilder {
|
|||
this.repoPathFull = `${this.buildPathFull}/${repositoryFolder}`;
|
||||
this.projectPathFull = `${this.repoPathFull}/${this.buildParams.projectPath}`;
|
||||
this.libraryFolderFull = `${this.projectPathFull}/Library`;
|
||||
yield RemoteBuilder.SetupStep(this.branchName);
|
||||
yield RemoteBuilder.SetupStep();
|
||||
yield RemoteBuilder.BuildStep(baseImage);
|
||||
yield RemoteBuilder.CompressionStep();
|
||||
yield RemoteBuilder.UploadArtifacts(this.branchName);
|
||||
yield RemoteBuilder.UploadArtifacts();
|
||||
if (this.SteamDeploy) {
|
||||
yield RemoteBuilder.DeployToSteam();
|
||||
}
|
||||
|
|
@ -2194,7 +2194,7 @@ class RemoteBuilder {
|
|||
}
|
||||
});
|
||||
}
|
||||
static SetupStep(branchName) {
|
||||
static SetupStep() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.info('Starting step 1/4 clone and restore cache)');
|
||||
const lfsDirectory = `${this.repoPathFull}/.git/lfs`;
|
||||
|
|
@ -2204,7 +2204,7 @@ class RemoteBuilder {
|
|||
const repo3 = `https://${this.buildParams.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 "${cacheFolderFull}" "${branchName}" "${this.libraryFolderFull}" "${lfsDirectory}" "${purgeRemoteCache}"`;
|
||||
const handleCaching = `${this.builderPathFull}/dist/remote-builder/handleCaching.sh "${cacheFolderFull}" ${this.libraryFolderFull}" "${lfsDirectory}" "${purgeRemoteCache}"`;
|
||||
yield this.RemoteBuilderProviderPlatform.runBuildTask(this.buildId, 'alpine/git', [
|
||||
` printenv
|
||||
#
|
||||
|
|
@ -2263,6 +2263,7 @@ class RemoteBuilder {
|
|||
chmod -R +x "/entrypoint.sh"
|
||||
chmod -R +x "/steps"
|
||||
/entrypoint.sh
|
||||
ls -lh
|
||||
`,
|
||||
], `/${buildVolumeFolder}`, `/${this.repoPathFull}`, RemoteBuilder.readBuildEnvironmentVariables(), buildSecrets);
|
||||
});
|
||||
|
|
@ -2277,7 +2278,6 @@ class RemoteBuilder {
|
|||
apk add zip -q
|
||||
apk add tree -q
|
||||
cd "${this.libraryFolderFull}"
|
||||
tree
|
||||
zip -r "lib-${this.buildId}.zip" "${this.libraryFolderFull}"
|
||||
mv "lib-${this.buildId}.zip" "${cacheFolderFull}/lib"
|
||||
cd "${this.projectPathFull}"
|
||||
|
|
@ -2294,14 +2294,14 @@ class RemoteBuilder {
|
|||
core.info('compression step complete');
|
||||
});
|
||||
}
|
||||
static UploadArtifacts(branchName) {
|
||||
static UploadArtifacts() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.info('Starting step 4/4 upload build to s3');
|
||||
yield this.RemoteBuilderProviderPlatform.runBuildTask(this.buildId, 'amazon/aws-cli', [
|
||||
`
|
||||
aws s3 cp ${this.buildId}/build-${this.buildId}.zip s3://game-ci-storage/
|
||||
# no need to upload Library cache for now
|
||||
# aws s3 cp /${buildVolumeFolder}/${cacheFolder}/${branchName}/lib-${this.buildId}.zip s3://game-ci-storage/
|
||||
# aws s3 cp "/${buildVolumeFolder}/${cacheFolder}/$branch/lib-${this.buildId}.zip" "s3://game-ci-storage/"
|
||||
${this.SteamDeploy ? '#' : ''} rm -r ${this.buildId}
|
||||
`,
|
||||
], `/${buildVolumeFolder}`, `/${buildVolumeFolder}/`, RemoteBuilder.readUploadArtifactEnvironmentVariables(), RemoteBuilder.readUploadArtifactsSecrets());
|
||||
|
|
@ -2365,6 +2365,11 @@ class RemoteBuilder {
|
|||
EnvironmentVariable: 'GITHUB_TOKEN',
|
||||
ParameterValue: this.buildParams.githubToken,
|
||||
},
|
||||
{
|
||||
ParameterKey: 'branch',
|
||||
EnvironmentVariable: 'branch',
|
||||
ParameterValue: this.branchName,
|
||||
},
|
||||
];
|
||||
}
|
||||
static readBuildSecrets(buildSecrets) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,11 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
cacheFolderFull=$1
|
||||
branch=$2
|
||||
libraryFolderFull=$3
|
||||
gitLFSDestinationFolder=$4
|
||||
purgeRemoteBuilderCache=$5
|
||||
LFS_ASSETS_HASH=$6
|
||||
libraryFolderFull=$2
|
||||
gitLFSDestinationFolder=$3
|
||||
purgeRemoteBuilderCache=$4
|
||||
LFS_ASSETS_HASH=$5
|
||||
|
||||
cacheFolderWithBranch="$cacheFolderFull/$branch"
|
||||
lfsCacheFolder="$cacheFolderFull/$branch/lfs"
|
||||
|
|
@ -66,6 +65,7 @@ du -sch "$cacheFolderFull"
|
|||
echo ' '
|
||||
|
||||
ls
|
||||
cd
|
||||
git lfs pull
|
||||
echo 'pulled latest LFS files'
|
||||
zip -q -r "$LFS_ASSETS_HASH.zip" "$gitLFSDestinationFolder"
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@ class RemoteBuilder {
|
|||
this.projectPathFull = `${this.repoPathFull}/${this.buildParams.projectPath}`;
|
||||
this.libraryFolderFull = `${this.projectPathFull}/Library`;
|
||||
|
||||
await RemoteBuilder.SetupStep(this.branchName);
|
||||
await RemoteBuilder.SetupStep();
|
||||
await RemoteBuilder.BuildStep(baseImage);
|
||||
await RemoteBuilder.CompressionStep();
|
||||
await RemoteBuilder.UploadArtifacts(this.branchName);
|
||||
await RemoteBuilder.UploadArtifacts();
|
||||
if (this.SteamDeploy) {
|
||||
await RemoteBuilder.DeployToSteam();
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ class RemoteBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
private static async SetupStep(branchName: string | undefined) {
|
||||
private static async SetupStep() {
|
||||
core.info('Starting step 1/4 clone and restore cache)');
|
||||
|
||||
const lfsDirectory = `${this.repoPathFull}/.git/lfs`;
|
||||
|
|
@ -87,7 +87,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 "${cacheFolderFull}" "${branchName}" "${this.libraryFolderFull}" "${lfsDirectory}" "${purgeRemoteCache}"`;
|
||||
const handleCaching = `${this.builderPathFull}/dist/remote-builder/handleCaching.sh "${cacheFolderFull}" ${this.libraryFolderFull}" "${lfsDirectory}" "${purgeRemoteCache}"`;
|
||||
await this.RemoteBuilderProviderPlatform.runBuildTask(
|
||||
this.buildId,
|
||||
'alpine/git',
|
||||
|
|
@ -156,6 +156,7 @@ class RemoteBuilder {
|
|||
chmod -R +x "/entrypoint.sh"
|
||||
chmod -R +x "/steps"
|
||||
/entrypoint.sh
|
||||
ls -lh
|
||||
`,
|
||||
],
|
||||
`/${buildVolumeFolder}`,
|
||||
|
|
@ -177,7 +178,6 @@ class RemoteBuilder {
|
|||
apk add zip -q
|
||||
apk add tree -q
|
||||
cd "${this.libraryFolderFull}"
|
||||
tree
|
||||
zip -r "lib-${this.buildId}.zip" "${this.libraryFolderFull}"
|
||||
mv "lib-${this.buildId}.zip" "${cacheFolderFull}/lib"
|
||||
cd "${this.projectPathFull}"
|
||||
|
|
@ -199,7 +199,7 @@ class RemoteBuilder {
|
|||
core.info('compression step complete');
|
||||
}
|
||||
|
||||
private static async UploadArtifacts(branchName: string | undefined) {
|
||||
private static async UploadArtifacts() {
|
||||
core.info('Starting step 4/4 upload build to s3');
|
||||
await this.RemoteBuilderProviderPlatform.runBuildTask(
|
||||
this.buildId,
|
||||
|
|
@ -208,7 +208,7 @@ class RemoteBuilder {
|
|||
`
|
||||
aws s3 cp ${this.buildId}/build-${this.buildId}.zip s3://game-ci-storage/
|
||||
# no need to upload Library cache for now
|
||||
# aws s3 cp /${buildVolumeFolder}/${cacheFolder}/${branchName}/lib-${this.buildId}.zip s3://game-ci-storage/
|
||||
# aws s3 cp "/${buildVolumeFolder}/${cacheFolder}/$branch/lib-${this.buildId}.zip" "s3://game-ci-storage/"
|
||||
${this.SteamDeploy ? '#' : ''} rm -r ${this.buildId}
|
||||
`,
|
||||
],
|
||||
|
|
@ -289,6 +289,11 @@ class RemoteBuilder {
|
|||
EnvironmentVariable: 'GITHUB_TOKEN',
|
||||
ParameterValue: this.buildParams.githubToken,
|
||||
},
|
||||
{
|
||||
ParameterKey: 'branch',
|
||||
EnvironmentVariable: 'branch',
|
||||
ParameterValue: this.branchName,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue