Minor tweaks and corrections for cloud runner pipeline and branch parameter (#351)

* Update cloud-runner-aws-pipeline.yml

* Update cloud-runner-k8s-pipeline.yml

* yarn build

* yarn build

* correct branch ref

* correct branch ref passed to target repo

* Create k8s-tests.yml

* Delete k8s-tests.yml

* correct branch ref passed to target repo

* correct branch ref passed to target repo
pull/359/head
Frostebite 2022-03-04 19:42:24 +00:00 committed by GitHub
parent 693ff829de
commit d975f3b80f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 9 deletions

View File

@ -1,7 +1,7 @@
name: Cloud Runner - AWS Tests
on:
push: { branches: [main, aws, remote-builder/unified-providers] }
push: { branches: [main, cloud-runner-develop] }
env:
GKE_ZONE: 'us-central1'
@ -15,7 +15,7 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-2
AWS_BASE_STACK_NAME: game-ci-github-pipelines
CLOUD_RUNNER_BRANCH: remote-builder/unified-providers
CLOUD_RUNNER_BRANCH: ${{ github.ref }}
CLOUD_RUNNER_TESTS: true
DEBUG: true
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

View File

@ -1,7 +1,7 @@
name: Cloud Runner - K8s Tests
on:
push: { branches: [remote-builder/k8s, remote-builder/unified-providers] }
push: { branches: [cloud-runner-develop] }
# push: { branches: [main] }
# pull_request:
# paths-ignore:
@ -20,7 +20,7 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-2
AWS_BASE_STACK_NAME: game-ci-github-pipelines
CLOUD_RUNNER_BRANCH: remote-builder/unified-providers
CLOUD_RUNNER_BRANCH: ${{ github.ref }}
CLOUD_RUNNER_TESTS: true
DEBUG: true
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

9
dist/index.js generated vendored
View File

@ -944,7 +944,7 @@ class SetupCloudRunnerRepository {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global advice.detachedHead false`);
remote_client_logger_1.RemoteClientLogger.log(`Cloning the repository being built:`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs install --skip-smudge`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ${path_1.default.resolve(`..`, path_1.default.basename(cloud_runner_state_1.CloudRunnerState.repoPathFull))}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git clone -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ${path_1.default.resolve(`..`, path_1.default.basename(cloud_runner_state_1.CloudRunnerState.repoPathFull))}`);
console_1.assert(fs_1.default.existsSync(`.git`));
remote_client_logger_1.RemoteClientLogger.log(`${cloud_runner_state_1.CloudRunnerState.buildParams.branch}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git checkout ${cloud_runner_state_1.CloudRunnerState.buildParams.branch}`);
@ -3015,6 +3015,11 @@ class SetupStep {
}
});
}
static getCloudRunnerBranch() {
var _a;
return ((_a = process.env.CLOUD_RUNNER_BRANCH) === null || _a === void 0 ? void 0 : _a.includes('/')) ? process.env.CLOUD_RUNNER_BRANCH.split('/').reverse()[0]
: process.env.CLOUD_RUNNER_BRANCH;
}
static downloadRepository(image, environmentVariables, secrets) {
return __awaiter(this, void 0, void 0, function* () {
try {
@ -3026,7 +3031,7 @@ class SetupStep {
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
git clone -q -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}"
git clone -q -b ${SetupStep.getCloudRunnerBranch()} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
node ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} -m remote-cli

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -55,7 +55,7 @@ export class SetupCloudRunnerRepository {
RemoteClientLogger.log(`Cloning the repository being built:`);
await CloudRunnerSystem.Run(`git lfs install --skip-smudge`);
await CloudRunnerSystem.Run(
`git clone ${CloudRunnerState.targetBuildRepoUrl} ${path.resolve(
`git clone -b ${CloudRunnerState.branchName} ${CloudRunnerState.targetBuildRepoUrl} ${path.resolve(
`..`,
path.basename(CloudRunnerState.repoPathFull),
)}`,

View File

@ -21,6 +21,12 @@ export class SetupStep implements StepInterface {
}
}
private static getCloudRunnerBranch() {
return process.env.CLOUD_RUNNER_BRANCH?.includes('/')
? process.env.CLOUD_RUNNER_BRANCH.split('/').reverse()[0]
: process.env.CLOUD_RUNNER_BRANCH;
}
private static async downloadRepository(
image: string,
environmentVariables: CloudRunnerEnvironmentVariable[],
@ -38,7 +44,7 @@ export class SetupStep implements StepInterface {
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
mkdir -p ${CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
git clone -q -b ${CloudRunnerState.branchName} ${
git clone -q -b ${SetupStep.getCloudRunnerBranch()} ${
CloudRunnerState.unityBuilderRepoUrl
} "${CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}"
${Input.cloudRunnerTests ? '' : '#'} tree ${CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}