Skip to content

Commit

Permalink
Reorganize Jenkins jobs
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
tianon committed Nov 18, 2024
1 parent 3d0d8ef commit f7d2ec6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
15 changes: 5 additions & 10 deletions Jenkinsfile.trigger
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down Expand Up @@ -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
]
Expand Down Expand Up @@ -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),
],
Expand Down

0 comments on commit f7d2ec6

Please sign in to comment.