diff --git a/Jenkinsfile b/Jenkinsfile index c90352f85..e9828b33e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 { diff --git a/Jenkinsfile.benchmarks b/Jenkinsfile.benchmarks index 53feedc50..2a1b61919 100644 --- a/Jenkinsfile.benchmarks +++ b/Jenkinsfile.benchmarks @@ -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()}"]) {