pull/289/head
Frostebite 2021-08-15 23:29:06 +00:00 committed by GitHub
parent f95077e853
commit d1ecc89a3e
5 changed files with 17 additions and 39 deletions

View File

@ -52,6 +52,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-2
remoteBuilderBranch: remote-builder/unified-providers
DEBUG: true
with:
remoteBuildCluster: aws

View File

@ -51,6 +51,7 @@ jobs:
id: k8s-unity-build
env:
DEBUG: true
remoteBuilderBranch: remote-builder/unified-providers
with:
remoteBuildCluster: k8s
targetPlatform: ${{ matrix.targetPlatform }}

26
dist/index.js vendored
View File

@ -2283,52 +2283,40 @@ class RemoteBuilder {
const lfsDirectory = `${this.repoPathFull}/.git/lfs`;
const testLFSFile = `${this.projectPathFull}/Assets/LFS_Test_File.jpg`;
const unityBuilderRepoUrl = `https://${this.buildParams.githubToken}@github.com/game-ci/unity-builder.git`;
const steamDeployRepoUrl = `https://${this.buildParams.githubToken}@github.com/game-ci/steam-deploy.git`;
const targetBuildRepoUrl = `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}" "${targetBuildRepoUrl}" "${testLFSFile}"`;
const handleCaching = `${this.builderPathFull}/dist/remote-builder/handleCaching.sh "${this.cacheFolderFull}" "${this.libraryFolderFull}" "${lfsDirectory}" "${purgeRemoteCache}"`;
const remoteBuilderBranch = process.env.remoteBuilderBranch ? `--branch "${process.env.remoteBuilderBranch}"` : '';
const cloneRemoteBuilder = `git clone -q ${remoteBuilderBranch} ${unityBuilderRepoUrl} ${this.builderPathFull}`;
yield this.RemoteBuilderProviderPlatform.runBuildTask(this.buildGuid, 'alpine/git', [
` printenv
#
apk update -q
apk add unzip zip git-lfs jq tree -q
#
mkdir -p ${this.buildPathFull}
mkdir -p ${this.builderPathFull}
mkdir -p ${this.repoPathFull}
mkdir -p ${this.steamPathFull}
#
echo ' '
echo 'Cloning utility repositories for remote builder'
git clone -q --branch "remote-builder/unified-providers" ${unityBuilderRepoUrl} ${this.builderPathFull}
echo 'Cloned ${unityBuilderRepoUrl}'
git clone -q ${steamDeployRepoUrl} ${this.steamPathFull}
echo 'Cloned ${steamDeployRepoUrl}'
#
${cloneRemoteBuilder}
echo ' '
echo 'Initializing source repository for cloning with caching of LFS files'
${initializeSourceRepoForCaching}
echo 'Source repository initialized'
export LFS_ASSETS_HASH="$(cat ${this.repoPathFull}/.lfs-assets-id)"
echo 'Source repository initialized'
echo ' '
${process.env.DEBUG ? '' : '#'}echo $LFS_ASSETS_HASH
${process.env.DEBUG ? '' : '#'}echo ' '
${process.env.DEBUG ? '' : '#'}echo 'Large File before LFS caching and pull'
${process.env.DEBUG ? '' : '#'}ls -alh "${lfsDirectory}"
${process.env.DEBUG ? '' : '#'}echo ' '
echo ' '
echo 'Starting checks of cache for the Unity project Library and git LFS files'
${handleCaching}
${process.env.DEBUG ? '' : '#'}echo 'Caching complete'
${process.env.DEBUG ? '' : '#'}echo ' '
${process.env.DEBUG ? '' : '#'}echo 'Large File after LFS caching and pull'
${process.env.DEBUG ? '' : '#'}ls -alh "${lfsDirectory}"
echo ' '
#
${process.env.DEBUG ? '' : '#'}echo ' '
${process.env.DEBUG ? '' : '#'}tree -L 4 "${this.buildPathFull}"
${process.env.DEBUG ? '' : '#'}ls -lh "/${buildVolumeFolder}"
echo ' '
#
${process.env.DEBUG ? '' : '#'}echo ' '
`,
], `/${buildVolumeFolder}`, `/${buildVolumeFolder}/`, RemoteBuilder.defaultGitShaEnvironmentVariable, this.defaultSecrets);
});

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -114,56 +114,44 @@ class RemoteBuilder {
const testLFSFile = `${this.projectPathFull}/Assets/LFS_Test_File.jpg`;
const unityBuilderRepoUrl = `https://${this.buildParams.githubToken}@github.com/game-ci/unity-builder.git`;
const steamDeployRepoUrl = `https://${this.buildParams.githubToken}@github.com/game-ci/steam-deploy.git`;
const targetBuildRepoUrl = `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}" "${targetBuildRepoUrl}" "${testLFSFile}"`;
const handleCaching = `${this.builderPathFull}/dist/remote-builder/handleCaching.sh "${this.cacheFolderFull}" "${this.libraryFolderFull}" "${lfsDirectory}" "${purgeRemoteCache}"`;
const remoteBuilderBranch = process.env.remoteBuilderBranch ? `--branch "${process.env.remoteBuilderBranch}"` : '';
const cloneRemoteBuilder = `git clone -q ${remoteBuilderBranch} ${unityBuilderRepoUrl} ${this.builderPathFull}`;
await this.RemoteBuilderProviderPlatform.runBuildTask(
this.buildGuid,
'alpine/git',
[
` printenv
#
apk update -q
apk add unzip zip git-lfs jq tree -q
#
mkdir -p ${this.buildPathFull}
mkdir -p ${this.builderPathFull}
mkdir -p ${this.repoPathFull}
mkdir -p ${this.steamPathFull}
#
echo ' '
echo 'Cloning utility repositories for remote builder'
git clone -q --branch "remote-builder/unified-providers" ${unityBuilderRepoUrl} ${this.builderPathFull}
echo 'Cloned ${unityBuilderRepoUrl}'
git clone -q ${steamDeployRepoUrl} ${this.steamPathFull}
echo 'Cloned ${steamDeployRepoUrl}'
#
${cloneRemoteBuilder}
echo ' '
echo 'Initializing source repository for cloning with caching of LFS files'
${initializeSourceRepoForCaching}
echo 'Source repository initialized'
export LFS_ASSETS_HASH="$(cat ${this.repoPathFull}/.lfs-assets-id)"
echo 'Source repository initialized'
echo ' '
${process.env.DEBUG ? '' : '#'}echo $LFS_ASSETS_HASH
${process.env.DEBUG ? '' : '#'}echo ' '
${process.env.DEBUG ? '' : '#'}echo 'Large File before LFS caching and pull'
${process.env.DEBUG ? '' : '#'}ls -alh "${lfsDirectory}"
${process.env.DEBUG ? '' : '#'}echo ' '
echo ' '
echo 'Starting checks of cache for the Unity project Library and git LFS files'
${handleCaching}
${process.env.DEBUG ? '' : '#'}echo 'Caching complete'
${process.env.DEBUG ? '' : '#'}echo ' '
${process.env.DEBUG ? '' : '#'}echo 'Large File after LFS caching and pull'
${process.env.DEBUG ? '' : '#'}ls -alh "${lfsDirectory}"
echo ' '
#
${process.env.DEBUG ? '' : '#'}echo ' '
${process.env.DEBUG ? '' : '#'}tree -L 4 "${this.buildPathFull}"
${process.env.DEBUG ? '' : '#'}ls -lh "/${buildVolumeFolder}"
echo ' '
#
${process.env.DEBUG ? '' : '#'}echo ' '
`,
],
`/${buildVolumeFolder}`,