Run build with input commands
parent
148569023b
commit
821b9eeddf
|
|
@ -849,7 +849,7 @@ class Kubernetes {
|
||||||
{
|
{
|
||||||
name: 'main',
|
name: 'main',
|
||||||
image,
|
image,
|
||||||
command: ['bin/bash', '-c', command],
|
command,
|
||||||
resources: {
|
resources: {
|
||||||
requests: {
|
requests: {
|
||||||
memory: this.buildParameters.remoteBuildMemory,
|
memory: this.buildParameters.remoteBuildMemory,
|
||||||
|
|
@ -957,7 +957,10 @@ class Kubernetes {
|
||||||
}
|
}
|
||||||
static runCloneJob() {
|
static runCloneJob() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
yield Kubernetes.runJob(`apk update;
|
yield Kubernetes.runJob([
|
||||||
|
'bin/sh',
|
||||||
|
'-c',
|
||||||
|
`apk update;
|
||||||
apk add git-lfs;
|
apk add git-lfs;
|
||||||
export GITHUB_TOKEN=$(cat /credentials/GITHUB_TOKEN);
|
export GITHUB_TOKEN=$(cat /credentials/GITHUB_TOKEN);
|
||||||
cd /data;
|
cd /data;
|
||||||
|
|
@ -965,12 +968,16 @@ class Kubernetes {
|
||||||
git clone https://github.com/webbertakken/unity-builder.git builder;
|
git clone https://github.com/webbertakken/unity-builder.git builder;
|
||||||
cd repo;
|
cd repo;
|
||||||
git checkout $GITHUB_SHA;
|
git checkout $GITHUB_SHA;
|
||||||
ls`, 'alpine/git');
|
ls`,
|
||||||
|
], 'alpine/git');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static runBuildJob() {
|
static runBuildJob() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
yield this.runJob(`ls
|
yield this.runJob([
|
||||||
|
'bin/bash',
|
||||||
|
'-c',
|
||||||
|
`ls
|
||||||
for f in ./credentials/*; do export $(basename $f)="$(cat $f)"; done
|
for f in ./credentials/*; do export $(basename $f)="$(cat $f)"; done
|
||||||
ls /data
|
ls /data
|
||||||
ls /data/builder
|
ls /data/builder
|
||||||
|
|
@ -981,7 +988,8 @@ class Kubernetes {
|
||||||
chmod -R +x /entrypoint.sh
|
chmod -R +x /entrypoint.sh
|
||||||
chmod -R +x /steps
|
chmod -R +x /steps
|
||||||
/entrypoint.sh
|
/entrypoint.sh
|
||||||
`, this.baseImage.toString());
|
`,
|
||||||
|
], this.baseImage.toString());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static watchPersistentVolumeClaimUntilReady() {
|
static watchPersistentVolumeClaimUntilReady() {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -103,7 +103,7 @@ class Kubernetes {
|
||||||
core.info('Persistent Volume created, waiting for ready state...');
|
core.info('Persistent Volume created, waiting for ready state...');
|
||||||
}
|
}
|
||||||
|
|
||||||
static async runJob(command: string, image: string) {
|
static async runJob(command: string[], image: string) {
|
||||||
core.info('Creating build job');
|
core.info('Creating build job');
|
||||||
const job = new k8s.V1Job();
|
const job = new k8s.V1Job();
|
||||||
job.apiVersion = 'batch/v1';
|
job.apiVersion = 'batch/v1';
|
||||||
|
|
@ -135,7 +135,7 @@ class Kubernetes {
|
||||||
{
|
{
|
||||||
name: 'main',
|
name: 'main',
|
||||||
image,
|
image,
|
||||||
command: ['bin/bash', '-c', command],
|
command,
|
||||||
resources: {
|
resources: {
|
||||||
requests: {
|
requests: {
|
||||||
memory: this.buildParameters.remoteBuildMemory,
|
memory: this.buildParameters.remoteBuildMemory,
|
||||||
|
|
@ -242,6 +242,9 @@ class Kubernetes {
|
||||||
|
|
||||||
static async runCloneJob() {
|
static async runCloneJob() {
|
||||||
await Kubernetes.runJob(
|
await Kubernetes.runJob(
|
||||||
|
[
|
||||||
|
'bin/sh',
|
||||||
|
'-c',
|
||||||
`apk update;
|
`apk update;
|
||||||
apk add git-lfs;
|
apk add git-lfs;
|
||||||
export GITHUB_TOKEN=$(cat /credentials/GITHUB_TOKEN);
|
export GITHUB_TOKEN=$(cat /credentials/GITHUB_TOKEN);
|
||||||
|
|
@ -251,12 +254,16 @@ class Kubernetes {
|
||||||
cd repo;
|
cd repo;
|
||||||
git checkout $GITHUB_SHA;
|
git checkout $GITHUB_SHA;
|
||||||
ls`,
|
ls`,
|
||||||
|
],
|
||||||
'alpine/git',
|
'alpine/git',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async runBuildJob() {
|
static async runBuildJob() {
|
||||||
await this.runJob(
|
await this.runJob(
|
||||||
|
[
|
||||||
|
'bin/bash',
|
||||||
|
'-c',
|
||||||
`ls
|
`ls
|
||||||
for f in ./credentials/*; do export $(basename $f)="$(cat $f)"; done
|
for f in ./credentials/*; do export $(basename $f)="$(cat $f)"; done
|
||||||
ls /data
|
ls /data
|
||||||
|
|
@ -269,6 +276,7 @@ class Kubernetes {
|
||||||
chmod -R +x /steps
|
chmod -R +x /steps
|
||||||
/entrypoint.sh
|
/entrypoint.sh
|
||||||
`,
|
`,
|
||||||
|
],
|
||||||
this.baseImage.toString(),
|
this.baseImage.toString(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue