pull/289/head
Frostebite 2021-08-15 21:32:43 +00:00 committed by GitHub
parent db44a88163
commit 4dcbc8c6fd
4 changed files with 12 additions and 11 deletions

6
dist/index.js vendored
View File

@ -2213,7 +2213,6 @@ const yaml_1 = __importDefault(__webpack_require__(13552));
const repositoryFolder = 'repo';
const buildVolumeFolder = 'data';
const cacheFolder = 'cache';
const cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}`;
class RemoteBuilder {
static build(buildParameters, baseImage) {
return __awaiter(this, void 0, void 0, function* () {
@ -2262,6 +2261,7 @@ class RemoteBuilder {
this.repoPathFull = `${this.buildPathFull}/${repositoryFolder}`;
this.projectPathFull = `${this.repoPathFull}/${this.buildParams.projectPath}`;
this.libraryFolderFull = `${this.projectPathFull}/Library`;
this.cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}/${this.branchName}`;
}
static SetupStep() {
return __awaiter(this, void 0, void 0, function* () {
@ -2273,7 +2273,7 @@ class RemoteBuilder {
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 "${cacheFolderFull}" "${this.libraryFolderFull}" "${lfsDirectory}" "${purgeRemoteCache}"`;
const handleCaching = `${this.builderPathFull}/dist/remote-builder/handleCaching.sh "${this.cacheFolderFull}" "${this.libraryFolderFull}" "${lfsDirectory}" "${purgeRemoteCache}"`;
yield this.RemoteBuilderProviderPlatform.runBuildTask(this.buildId, 'alpine/git', [
` printenv
#
@ -2348,7 +2348,7 @@ class RemoteBuilder {
apk add zip -q
cd "${this.libraryFolderFull}"
zip -r "lib-${this.buildId}.zip" "${this.libraryFolderFull}"
mv "lib-${this.buildId}.zip" "${cacheFolderFull}/lib"
mv "lib-${this.buildId}.zip" "${this.cacheFolderFull}/lib"
cd "${this.projectPathFull}"
ls -lh "${this.projectPathFull}"
zip -r "build-${this.buildId}.zip" "${this.projectPathFull}/${RemoteBuilder.buildParams.buildPath}"

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -5,9 +5,9 @@ libraryFolderFull=$2
gitLFSDestinationFolder=$3
purgeRemoteBuilderCache=$4
cacheFolderWithBranch="$cacheFolderFull/$branch"
lfsCacheFolder="$cacheFolderFull/$branch/lfs"
libraryCacheFolder="$cacheFolderFull/$branch/lib"
cacheFolderWithBranch="$cacheFolderFull"
lfsCacheFolder="$cacheFolderFull/lfs"
libraryCacheFolder="$cacheFolderFull/lib"
mkdir -p "$lfsCacheFolder"
mkdir -p "$libraryCacheFolder"
@ -24,7 +24,7 @@ fi
ls -lh "$libraryCacheFolder"
latestLibraryCacheFile=$(ls -t "$libraryCacheFolder" | grep .zip$ | head -1)
echo "Checking if $libraryCacheFolder/$latestLibraryCacheFile exists from $branch"
echo "Checking if $libraryCacheFolder/$latestLibraryCacheFile"
if [ -z "$libraryCacheFolder/$latestLibraryCacheFile" ]; then
echo "Library cache exists"
mkdir -p "$libraryFolderFull"

View File

@ -11,7 +11,6 @@ import YAML from 'yaml';
const repositoryFolder = 'repo';
const buildVolumeFolder = 'data';
const cacheFolder = 'cache';
const cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}`;
class RemoteBuilder {
static RemoteBuilderProviderPlatform: RemoteBuilderProviderInterface;
@ -25,6 +24,7 @@ class RemoteBuilder {
private static repoPathFull: string;
private static projectPathFull: string;
private static libraryFolderFull: string;
private static cacheFolderFull: string;
static SteamDeploy: boolean = process.env.STEAM_DEPLOY !== undefined || false;
private static readonly defaultGitShaEnvironmentVariable = [
{
@ -98,6 +98,7 @@ class RemoteBuilder {
this.repoPathFull = `${this.buildPathFull}/${repositoryFolder}`;
this.projectPathFull = `${this.repoPathFull}/${this.buildParams.projectPath}`;
this.libraryFolderFull = `${this.projectPathFull}/Library`;
this.cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}/${this.branchName}`;
}
private static async SetupStep() {
@ -112,7 +113,7 @@ class RemoteBuilder {
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 "${cacheFolderFull}" "${this.libraryFolderFull}" "${lfsDirectory}" "${purgeRemoteCache}"`;
const handleCaching = `${this.builderPathFull}/dist/remote-builder/handleCaching.sh "${this.cacheFolderFull}" "${this.libraryFolderFull}" "${lfsDirectory}" "${purgeRemoteCache}"`;
await this.RemoteBuilderProviderPlatform.runBuildTask(
this.buildId,
'alpine/git',
@ -204,7 +205,7 @@ class RemoteBuilder {
apk add zip -q
cd "${this.libraryFolderFull}"
zip -r "lib-${this.buildId}.zip" "${this.libraryFolderFull}"
mv "lib-${this.buildId}.zip" "${cacheFolderFull}/lib"
mv "lib-${this.buildId}.zip" "${this.cacheFolderFull}/lib"
cd "${this.projectPathFull}"
ls -lh "${this.projectPathFull}"
zip -r "build-${this.buildId}.zip" "${this.projectPathFull}/${RemoteBuilder.buildParams.buildPath}"