Skip to content

Commit

Permalink
jobs/build-mechanical: schedule at off-peak and run builds serially
Browse files Browse the repository at this point in the history
Adjust the cron schedule trigger to start at 2am UTC every day to
run this job at off-peak times. Also, run the scheduled builds
serially by waiting for each build to finish before starting the
next one.
  • Loading branch information
marmijo committed Dec 20, 2024
1 parent 27486aa commit ba0f037
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions jobs/build-mechanical.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ node {

properties([
pipelineTriggers([
// run every 24h only for now
cron("H H * * *")
// run every 24h at 2am UTC
cron("0 2 * * *")
]),
buildDiscarder(logRotator(
numToKeepStr: '100',
Expand All @@ -25,10 +25,14 @@ node {
}

mechanical_streams.each{
echo "Triggering build for mechanical stream: ${it}"
build job: 'build', wait: false, parameters: [
string(name: 'STREAM', value: it),
booleanParam(name: 'EARLY_ARCH_JOBS', value: false)
]
try {
echo "Triggering build for mechanical stream: ${it}"
build job: 'build', wait: true, parameters: [
string(name: 'STREAM', value: it),
booleanParam(name: 'EARLY_ARCH_JOBS', value: false)
]
} catch (e) {
echo "Build failed for mechanical stream: ${it}"
}
}
}

0 comments on commit ba0f037

Please sign in to comment.