From d975f3b80f2c02df508066ce2a8ac0bc723d4507 Mon Sep 17 00:00:00 2001 From: Frostebite Date: Fri, 4 Mar 2022 19:42:24 +0000 Subject: [PATCH] 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 --- .../workflows/cloud-runner-aws-pipeline.yml | 4 ++-- .../workflows/cloud-runner-k8s-pipeline.yml | 4 ++-- dist/index.js | Bin 21817161 -> 21817478 bytes dist/index.js.map | Bin 16174142 -> 16174494 bytes .../setup-cloud-runner-repository.ts | 2 +- src/model/cloud-runner/steps/setup-step.ts | 8 +++++++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cloud-runner-aws-pipeline.yml b/.github/workflows/cloud-runner-aws-pipeline.yml index 3debe66c..0d1fc858 100644 --- a/.github/workflows/cloud-runner-aws-pipeline.yml +++ b/.github/workflows/cloud-runner-aws-pipeline.yml @@ -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 }} diff --git a/.github/workflows/cloud-runner-k8s-pipeline.yml b/.github/workflows/cloud-runner-k8s-pipeline.yml index 00ad445f..b8b308e3 100644 --- a/.github/workflows/cloud-runner-k8s-pipeline.yml +++ b/.github/workflows/cloud-runner-k8s-pipeline.yml @@ -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 }} diff --git a/dist/index.js b/dist/index.js index a514237cc0edd47aa858bdd266b0ae2ed6f5c305..d3e9d8cdef6077992f32fd7081b67bc242921d89 100644 GIT binary patch delta 1688 zcmajfX;f5Y9LMo<0T%`l+1!_LgBg?ocLf1qKye9ekjj-1Zc5TH%|dCKnu(T`n&qfz zsckMT)@0;Ld)Z=Ygr%MJ7r#_ySyq; zVft*zX~}lGHRp0~Ieea~O8>>(4zF2bdVQwNJ}G@lw8i?Lm2tUaGB53)yK+KSbX{CV zSbey)*z^ZH#eUP{_}}ldFJ=e`M+BOnDVm`Jq{ z43A?owqPr^;R!s6r|>kk;~6}Q5T3&hJdZlOfSuTd-PnV@*oS(&h?np(Ucsw)4X@)3 zyovpI3vc5cyo&>P4+n7whw(l>z=vqS5gf%a9LEWKgpctFKE-GF9ADr|e1)&^4Zg)m zoWghb9zWnm{DhzJ3x36EoWWWAhI9BGf8bA?#|8X_ztM<)mKxc{GALn6xDuf>QJN~v zl;%pLVo{=$7D}|zQi)MoDX~hN60amEiArmwjnY@nfN@t~uVpX~--IVT1 z52dG)q$Ddg#jd0%y_DWcs^U=6lys$!(pTxH^j8Kb1C>F_U}cDsp=2sUl`Q4r)N=GR gOvzR96sMA}6ez=$5lW#lQW>R;HtPA67=>H@1Kiz7;JLDTSn@tcrTAP@zHg-r2JE-l7mf$liNXL`L=&8CltT?>(Qt z55MQ!kN4aUH#Rfb`gBIJ_4cgfL}QwFj4376lwxp*O^pgPrkf?12OGVTvK@_9i8d)E zn zfm*1INYp`H)I)tVKtnV_V>CfiG(&T=KufejYqUXIv_llyqXRmk6FQ>{x}qDR(H%X| z6TQ$Ieb5*E&>sUZ5Q8unLogJ>FdQQ=5~DC0V=xxuFdh>SgNc}gSj1s6reG@KF%8o( z0|}UkS(uGP%)wmDLlWj=0TyBr7GnvPVi}fW1y*7eR$~p;Vjb3F12$q4He(C6VjH$& z2X-PEDcFVGNW~uPMH=>DKMvp^(s2lfaRf(k499T-Cvgg=aRz5`4(E}93%H0(T*75s z!Bu488m{98ZsHcQaT|AV7x!=<5AYC=@EA|<6wmM+FYpqt@EULM7Vq#LAMg>M@EKq5 z72oh3KkyU3@Ed>dH$FPZkO0M~m?`Fpg_1+bsaPsjinU^+*ebb{+)5tBPO(?=D)|%# zCBNdRI4K1bXT?P+s1#BPE3Qfr#Z4)yxGNq?F~w6Uu6QZlN(rT;Qc5YUlu>*XU&T); ztCUmxl>o)0lvgS!6_rX#WhGFlqEuC?DgRFwtSLmPuGCO!Dxpf460SrjwUpXQq#>PG IVsPE?5B2FM761SM diff --git a/dist/index.js.map b/dist/index.js.map index 5a73f7b86cde0593bf203acc36dd443dbf9c34c7..6698530ba38dee6400819aa73432f497b5e4fec5 100644 GIT binary patch delta 1301 zcmajZXH?Ar7{~E*t<;sML`L0vL*3%aNM=$}bQL#Ql~Df%x!vx_CNmis(LXCIJ0bBm zvv>cS57P#^YifFl~f2@TN*&S;D#Xo_ZVk+goUH_OBmYm~8>A##Nj zB3Bk>+a(I-z?4)=yw0N63&sG^+eg(v^v|uTA!em1oW%DIDl1omF*QywnKXhvT@$Dc zkL(qziwp}3(!~bodWHpti1i~YJ%f|=aVeH~!Q|oI#$Bye^icd~OJg#mB%6OvYm7p= zU^EFH>L_n9p`FUb@tI-?7^q8qxy4?Wk(WN0q2&A#{h@(yLZGE5H!h+gFK2Kqsmm&@%ZgwKkql)R!-?V$qKP3uEQfL! zBRHHmjv$^RIf?|1<`_nDEQyTbIFiD3S;@5>p|-MMT4{A4C0rc{HkF49YJy#np^V00 zYN)q0B|20XNI9jnxFN{#oWO~k#As4U<75VZr*azUjNx?7;7raUgRz{=Ib<@9b2*Rm z$s(Hz7|(@F;36h+F_$ojOSz28xq=*WnamWXlE;-?MLt(^4cBrV*K-5YxRINUcI+`%knGlx5w%U#?}A@?wk`P|EW+|L6n;6WZ@ArG^N#XLe0ODJY3k5a-i z9%DJBJkAq5Nf}SEf^web87g>|N}l6+st8fdN>))rEp^n>z-rde$XZ_DMPA}%Ug1?< z<8_*NgEx7LX5Qu%$t;&1-p NApeGo8~#fg^FMBcEKUFb diff --git a/src/model/cli/remote-client/setup-cloud-runner-repository.ts b/src/model/cli/remote-client/setup-cloud-runner-repository.ts index e8240d88..b08b9d7e 100644 --- a/src/model/cli/remote-client/setup-cloud-runner-repository.ts +++ b/src/model/cli/remote-client/setup-cloud-runner-repository.ts @@ -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), )}`, diff --git a/src/model/cloud-runner/steps/setup-step.ts b/src/model/cloud-runner/steps/setup-step.ts index cef427c7..b0da16da 100644 --- a/src/model/cloud-runner/steps/setup-step.ts +++ b/src/model/cloud-runner/steps/setup-step.ts @@ -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, `/`)}