Skip to content

Commit ba0f037

Browse files
committed
jobs/build-mechanical: schedule at off-peak and run builds serially
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.
1 parent 27486aa commit ba0f037

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

jobs/build-mechanical.Jenkinsfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ node {
77

88
properties([
99
pipelineTriggers([
10-
// run every 24h only for now
11-
cron("H H * * *")
10+
// run every 24h at 2am UTC
11+
cron("0 2 * * *")
1212
]),
1313
buildDiscarder(logRotator(
1414
numToKeepStr: '100',
@@ -25,10 +25,14 @@ node {
2525
}
2626

2727
mechanical_streams.each{
28-
echo "Triggering build for mechanical stream: ${it}"
29-
build job: 'build', wait: false, parameters: [
30-
string(name: 'STREAM', value: it),
31-
booleanParam(name: 'EARLY_ARCH_JOBS', value: false)
32-
]
28+
try {
29+
echo "Triggering build for mechanical stream: ${it}"
30+
build job: 'build', wait: true, parameters: [
31+
string(name: 'STREAM', value: it),
32+
booleanParam(name: 'EARLY_ARCH_JOBS', value: false)
33+
]
34+
} catch (e) {
35+
echo "Build failed for mechanical stream: ${it}"
36+
}
3337
}
3438
}

0 commit comments

Comments
 (0)