From f7d2ec62baf37675fd5662fbd8c312713edf2e4e Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 18 Nov 2024 15:20:36 -0800 Subject: [PATCH] Reorganize Jenkins jobs Before: ``` multiarch/ARCH/REPO (old, disabled) wip/new/meta wip/new/trigger-gha wip/new/trigger-ARCH wip/new/build-ARCH wip/new/deploy-ARCH ``` After: ("the meta build system") ``` multiarch/ARCH/REPO (old, disabled, could be removed) meta/meta meta/ARCH/trigger meta/ARCH/build meta/ARCH/deploy ``` --- Jenkinsfile.build | 2 +- Jenkinsfile.deploy | 4 ++-- Jenkinsfile.trigger | 15 +++++---------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile.build b/Jenkinsfile.build index 503ea2f..8d7349b 100644 --- a/Jenkinsfile.build +++ b/Jenkinsfile.build @@ -8,7 +8,7 @@ properties([ ]), ]) -env.BASHBREW_ARCH = env.JOB_NAME.split('/')[-1].minus('build-') // "windows-amd64", "arm64v8", etc +env.BASHBREW_ARCH = env.JOB_NAME.minus('/build').split('/')[-1] // "windows-amd64", "arm64v8", etc env.BUILD_ID = params.buildId node('multiarch-' + env.BASHBREW_ARCH) { ansiColor('xterm') { diff --git a/Jenkinsfile.deploy b/Jenkinsfile.deploy index f49d892..58b656f 100644 --- a/Jenkinsfile.deploy +++ b/Jenkinsfile.deploy @@ -9,12 +9,12 @@ properties([ userBoost: true, ]), pipelineTriggers([ - upstream('meta'), + upstream('../meta'), cron('H H/6 * * *'), // run every few hours whether we "need" it or not ]), ]) -env.BASHBREW_ARCH = env.JOB_NAME.split('/')[-1].minus('deploy-') // "windows-amd64", "arm64v8", etc +env.BASHBREW_ARCH = env.JOB_NAME.minus('/deploy').split('/')[-1] // "windows-amd64", "arm64v8", etc node('put-shared') { ansiColor('xterm') { stage('Checkout') { diff --git a/Jenkinsfile.trigger b/Jenkinsfile.trigger index ab4d3cb..1ce38d3 100644 --- a/Jenkinsfile.trigger +++ b/Jenkinsfile.trigger @@ -8,7 +8,7 @@ properties([ ]), ]) -env.BASHBREW_ARCH = env.JOB_NAME.split('/')[-1].minus('trigger-') // "windows-amd64", "arm64v8", etc +env.BASHBREW_ARCH = env.JOB_NAME.minus('/trigger').split('/')[-1] // "windows-amd64", "arm64v8", etc def queue = [] def breakEarly = false // thanks Jenkins... @@ -63,15 +63,10 @@ node { .[] | select( needs_build - and ( - .build.arch as $arch - | if env.BASHBREW_ARCH == "gha" then - [ "amd64", "i386", "windows-amd64" ] - else [ env.BASHBREW_ARCH ] end - | index($arch) - ) + and .build.arch == env.BASHBREW_ARCH ) - | if env.BASHBREW_ARCH == "gha" then + | if .build.arch | IN("amd64", "i386", "windows-amd64") then + # "GHA" architectures (anything we add a "gha_payload" to will be run on GHA in the queue) .gha_payload = (gha_payload | @json) else . end ] @@ -137,7 +132,7 @@ for (buildObj in queue) { } } else { def res = build( - job: 'build-' + env.BASHBREW_ARCH, + job: 'build', parameters: [ string(name: 'buildId', value: buildObj.buildId), ],