Skip to content

Commit 1bddea8

Browse files
committed
Don't run pre-build or build RPMs on timed builds.
Move startedBy* to pipeline-lib. Add Simulate-timed-job pragma. Skip-PR-comments: true #Pragmas from previous commit message: Skip-PR-comments: true #Pragmas from previous commit message: Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Skip-PR-comments: true Signed-off-by: Brian J. Murrell <[email protected]>
1 parent 6d1b4e3 commit 1bddea8

File tree

6 files changed

+43
-4
lines changed

6 files changed

+43
-4
lines changed

vars/daosPackagesVersion.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ String call(String distro, String next_version) {
5858
String target_branch = env.CHANGE_TARGET ? env.CHANGE_TARGET : env.BRANCH_NAME
5959

6060
if (target_branch.startsWith("weekly-testing") ||
61-
target_branch.startsWith("provider-testing")) {
62-
// weekly-test just wants the latest for the branch
61+
target_branch.startsWith("provider-testing") ||
62+
startedByTimer()) {
63+
// weekly-test, provider-testing and timed builds just wants the latest
64+
// for the branch
6365
if (rpm_version_cache != "" && rpm_version_cache != "locked") {
6466
return rpm_version_cache + rpm_dist(distro)
6567
}

vars/daosRepos.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ String daos_repo() {
1515
String target_branch = env.CHANGE_TARGET ? env.CHANGE_TARGET : env.BRANCH_NAME
1616

1717
if (target_branch.startsWith("weekly-testing") ||
18-
target_branch.startsWith("provider-testing")) {
18+
target_branch.startsWith("provider-testing") ||
19+
startedByTimer()) {
1920
return ""
2021
}
2122

vars/provisionNodes.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def call(Map config = [:]) {
145145
'INST_REPOS="' + inst_repos + '" ' +
146146
'INST_RPMS="' + inst_rpms + '" ' +
147147
'GPG_KEY_URLS="' + gpg_key_urls.join(' ') + '" ' +
148+
'TIMED_JOB=' + startedByTimer() + ' ' +
148149
'ci/provisioning/post_provision_config.sh'
149150
new_config['post_restore'] = provision_script
150151
try {

vars/skipStage.groovy

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ boolean call(Map config = [:]) {
143143
return docOnlyChange(target_branch) ||
144144
target_branch == 'weekly-testing' ||
145145
rpmTestVersion() != '' ||
146-
quickBuild()
146+
quickBuild() ||
147+
startedByTimer()
147148
case "checkpatch":
148149
return skip_stage_pragma('checkpatch')
149150
case "Python Bandit check":
@@ -161,27 +162,31 @@ boolean call(Map config = [:]) {
161162
(docOnlyChange(target_branch) &&
162163
prRepos('centos7') == '') ||
163164
prRepos('centos7').contains('daos@') ||
165+
startedByTimer() ||
164166
skip_stage_pragma('build-centos7-rpm')
165167
case "Build RPM on EL 8":
166168
case "Build RPM on CentOS 8":
167169
return paramsValue('CI_RPM_el8_NOBUILD', false) ||
168170
(docOnlyChange(target_branch) &&
169171
prRepos('el8') == '') ||
170172
prRepos('el8').contains('daos@') ||
173+
startedByTimer() ||
171174
skip_stage_pragma('build-el8-rpm')
172175
case "Build RPM on Leap 15":
173176
return paramsValue('CI_RPM_leap15_NOBUILD', false) ||
174177
target_branch == 'weekly-testing' ||
175178
(docOnlyChange(target_branch) &&
176179
prRepos('leap15') == '') ||
177180
prRepos('leap15').contains('daos@') ||
181+
startedByTimer() ||
178182
skip_stage_pragma('build-leap15-rpm')
179183
case "Build DEB on Ubuntu 20.04":
180184
return paramsValue('CI_RPM_ubuntu20_NOBUILD', false) ||
181185
target_branch == 'weekly-testing' ||
182186
(docOnlyChange(target_branch) &&
183187
prRepos('ubuntu20') == '') ||
184188
prRepos('ubuntu20').contains('daos@') ||
189+
startedByTimer() ||
185190
skip_stage_pragma('build-ubuntu20-rpm')
186191
case "Build on CentOS 8":
187192
case "Build on EL 8":

vars/startedByTimer.groovy

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* groovylint-disable VariableName */
2+
// vars/startedByTimer.groovy
3+
4+
/**
5+
* Return True the build was started by a timer
6+
*/
7+
Boolean call() {
8+
9+
Boolean simulate_timed_job = cachedCommitPragma('Simulate-timed-job') == 'true'
10+
11+
if (simulate_timed_job) {
12+
println('Simulating timed job behaviour')
13+
}
14+
15+
return simulate_timed_job ||
16+
/* groovylint-disable-next-line UnnecessaryGetter */
17+
currentBuild.getBuildCauses().toString().contains('hudson.triggers.TimerTrigger$TimerTriggerCause')
18+
19+
}

vars/startedByUser.groovy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// vars/startedByUser.groovy
2+
3+
/**
4+
* Return True if the build was caused by a User (I.e. Build Now)
5+
*/
6+
Boolean call(Map config = [:]) {
7+
8+
/* groovylint-disable-next-line UnnecessaryGetter */
9+
return currentBuild.getBuildCauses().toString().contains('hudson.model.Cause$UserIdCause')
10+
11+
}

0 commit comments

Comments
 (0)