Jenkins: don't abort older jobs in master/devel (#1746)

* Jenkins: don't abort older jobs in master/devel

* same for Jenkinsfile.benchmarks
This commit is contained in:
Ștefan Talpalaru 2020-09-25 12:26:59 +02:00 committed by GitHub
parent 6cf7e837ce
commit 3936caae4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

11
Jenkinsfile vendored
View File

@ -1,9 +1,12 @@
// https://stackoverflow.com/questions/40760716/jenkins-abort-running-build-if-new-one-is-started
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) {
milestone(buildNumber - 1)
// We should only abort older jobs in PR branches, so we have a nice CI history in "master" and "devel".
if (env.BRANCH_NAME != "master" && env.BRANCH_NAME != "devel") {
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) {
milestone(buildNumber - 1)
}
milestone(buildNumber)
}
milestone(buildNumber)
def runStages() {
try {

View File

@ -1,9 +1,12 @@
// https://stackoverflow.com/questions/40760716/jenkins-abort-running-build-if-new-one-is-started
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) {
milestone(buildNumber - 1)
// We should only abort older jobs in PR branches, so we have a nice CI history in "master" and "devel".
if (env.BRANCH_NAME != "master" && env.BRANCH_NAME != "devel") {
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) {
milestone(buildNumber - 1)
}
milestone(buildNumber)
}
milestone(buildNumber)
node("metal") {
withEnv(["NPROC=${sh(returnStdout: true, script: 'nproc').trim()}"]) {