fix
parent
db44a88163
commit
4dcbc8c6fd
|
|
@ -2213,7 +2213,6 @@ const yaml_1 = __importDefault(__webpack_require__(13552));
|
||||||
const repositoryFolder = 'repo';
|
const repositoryFolder = 'repo';
|
||||||
const buildVolumeFolder = 'data';
|
const buildVolumeFolder = 'data';
|
||||||
const cacheFolder = 'cache';
|
const cacheFolder = 'cache';
|
||||||
const cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}`;
|
|
||||||
class RemoteBuilder {
|
class RemoteBuilder {
|
||||||
static build(buildParameters, baseImage) {
|
static build(buildParameters, baseImage) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
|
@ -2262,6 +2261,7 @@ class RemoteBuilder {
|
||||||
this.repoPathFull = `${this.buildPathFull}/${repositoryFolder}`;
|
this.repoPathFull = `${this.buildPathFull}/${repositoryFolder}`;
|
||||||
this.projectPathFull = `${this.repoPathFull}/${this.buildParams.projectPath}`;
|
this.projectPathFull = `${this.repoPathFull}/${this.buildParams.projectPath}`;
|
||||||
this.libraryFolderFull = `${this.projectPathFull}/Library`;
|
this.libraryFolderFull = `${this.projectPathFull}/Library`;
|
||||||
|
this.cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}/${this.branchName}`;
|
||||||
}
|
}
|
||||||
static SetupStep() {
|
static SetupStep() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
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 targetBuildRepoUrl = `https://${this.buildParams.githubToken}@github.com/${process.env.GITHUB_REPOSITORY}.git`;
|
||||||
const purgeRemoteCache = process.env.PURGE_REMOTE_BUILDER_CACHE !== undefined;
|
const purgeRemoteCache = process.env.PURGE_REMOTE_BUILDER_CACHE !== undefined;
|
||||||
const initializeSourceRepoForCaching = `${this.builderPathFull}/dist/remote-builder/cloneNoLFS.sh "${this.repoPathFull}" "${targetBuildRepoUrl}" "${testLFSFile}"`;
|
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', [
|
yield this.RemoteBuilderProviderPlatform.runBuildTask(this.buildId, 'alpine/git', [
|
||||||
` printenv
|
` printenv
|
||||||
#
|
#
|
||||||
|
|
@ -2348,7 +2348,7 @@ class RemoteBuilder {
|
||||||
apk add zip -q
|
apk add zip -q
|
||||||
cd "${this.libraryFolderFull}"
|
cd "${this.libraryFolderFull}"
|
||||||
zip -r "lib-${this.buildId}.zip" "${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}"
|
cd "${this.projectPathFull}"
|
||||||
ls -lh "${this.projectPathFull}"
|
ls -lh "${this.projectPathFull}"
|
||||||
zip -r "build-${this.buildId}.zip" "${this.projectPathFull}/${RemoteBuilder.buildParams.buildPath}"
|
zip -r "build-${this.buildId}.zip" "${this.projectPathFull}/${RemoteBuilder.buildParams.buildPath}"
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -5,9 +5,9 @@ libraryFolderFull=$2
|
||||||
gitLFSDestinationFolder=$3
|
gitLFSDestinationFolder=$3
|
||||||
purgeRemoteBuilderCache=$4
|
purgeRemoteBuilderCache=$4
|
||||||
|
|
||||||
cacheFolderWithBranch="$cacheFolderFull/$branch"
|
cacheFolderWithBranch="$cacheFolderFull"
|
||||||
lfsCacheFolder="$cacheFolderFull/$branch/lfs"
|
lfsCacheFolder="$cacheFolderFull/lfs"
|
||||||
libraryCacheFolder="$cacheFolderFull/$branch/lib"
|
libraryCacheFolder="$cacheFolderFull/lib"
|
||||||
|
|
||||||
mkdir -p "$lfsCacheFolder"
|
mkdir -p "$lfsCacheFolder"
|
||||||
mkdir -p "$libraryCacheFolder"
|
mkdir -p "$libraryCacheFolder"
|
||||||
|
|
@ -24,7 +24,7 @@ fi
|
||||||
ls -lh "$libraryCacheFolder"
|
ls -lh "$libraryCacheFolder"
|
||||||
latestLibraryCacheFile=$(ls -t "$libraryCacheFolder" | grep .zip$ | head -1)
|
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
|
if [ -z "$libraryCacheFolder/$latestLibraryCacheFile" ]; then
|
||||||
echo "Library cache exists"
|
echo "Library cache exists"
|
||||||
mkdir -p "$libraryFolderFull"
|
mkdir -p "$libraryFolderFull"
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import YAML from 'yaml';
|
||||||
const repositoryFolder = 'repo';
|
const repositoryFolder = 'repo';
|
||||||
const buildVolumeFolder = 'data';
|
const buildVolumeFolder = 'data';
|
||||||
const cacheFolder = 'cache';
|
const cacheFolder = 'cache';
|
||||||
const cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}`;
|
|
||||||
|
|
||||||
class RemoteBuilder {
|
class RemoteBuilder {
|
||||||
static RemoteBuilderProviderPlatform: RemoteBuilderProviderInterface;
|
static RemoteBuilderProviderPlatform: RemoteBuilderProviderInterface;
|
||||||
|
|
@ -25,6 +24,7 @@ class RemoteBuilder {
|
||||||
private static repoPathFull: string;
|
private static repoPathFull: string;
|
||||||
private static projectPathFull: string;
|
private static projectPathFull: string;
|
||||||
private static libraryFolderFull: string;
|
private static libraryFolderFull: string;
|
||||||
|
private static cacheFolderFull: string;
|
||||||
static SteamDeploy: boolean = process.env.STEAM_DEPLOY !== undefined || false;
|
static SteamDeploy: boolean = process.env.STEAM_DEPLOY !== undefined || false;
|
||||||
private static readonly defaultGitShaEnvironmentVariable = [
|
private static readonly defaultGitShaEnvironmentVariable = [
|
||||||
{
|
{
|
||||||
|
|
@ -98,6 +98,7 @@ class RemoteBuilder {
|
||||||
this.repoPathFull = `${this.buildPathFull}/${repositoryFolder}`;
|
this.repoPathFull = `${this.buildPathFull}/${repositoryFolder}`;
|
||||||
this.projectPathFull = `${this.repoPathFull}/${this.buildParams.projectPath}`;
|
this.projectPathFull = `${this.repoPathFull}/${this.buildParams.projectPath}`;
|
||||||
this.libraryFolderFull = `${this.projectPathFull}/Library`;
|
this.libraryFolderFull = `${this.projectPathFull}/Library`;
|
||||||
|
this.cacheFolderFull = `/${buildVolumeFolder}/${cacheFolder}/${this.branchName}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async SetupStep() {
|
private static async SetupStep() {
|
||||||
|
|
@ -112,7 +113,7 @@ class RemoteBuilder {
|
||||||
|
|
||||||
const purgeRemoteCache = process.env.PURGE_REMOTE_BUILDER_CACHE !== undefined;
|
const purgeRemoteCache = process.env.PURGE_REMOTE_BUILDER_CACHE !== undefined;
|
||||||
const initializeSourceRepoForCaching = `${this.builderPathFull}/dist/remote-builder/cloneNoLFS.sh "${this.repoPathFull}" "${targetBuildRepoUrl}" "${testLFSFile}"`;
|
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(
|
await this.RemoteBuilderProviderPlatform.runBuildTask(
|
||||||
this.buildId,
|
this.buildId,
|
||||||
'alpine/git',
|
'alpine/git',
|
||||||
|
|
@ -204,7 +205,7 @@ class RemoteBuilder {
|
||||||
apk add zip -q
|
apk add zip -q
|
||||||
cd "${this.libraryFolderFull}"
|
cd "${this.libraryFolderFull}"
|
||||||
zip -r "lib-${this.buildId}.zip" "${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}"
|
cd "${this.projectPathFull}"
|
||||||
ls -lh "${this.projectPathFull}"
|
ls -lh "${this.projectPathFull}"
|
||||||
zip -r "build-${this.buildId}.zip" "${this.projectPathFull}/${RemoteBuilder.buildParams.buildPath}"
|
zip -r "build-${this.buildId}.zip" "${this.projectPathFull}/${RemoteBuilder.buildParams.buildPath}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue