From a5577ea660d98051e9c8d682485f9749e85b2a8d Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Sun, 24 Mar 2019 17:40:20 -0600 Subject: [PATCH] CI: kill older running builds --- Jenkinsfile | 14 ++++++++++++++ contrib/ci/Jenkinsfile.osx | 22 ++++++++++++++++++++++ contrib/ci/Jenkinsfile.tidy | 24 ++++++++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index c2b78f390a..2475c22daf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,25 @@ #!groovy +// load library https://github.com/tjhei/jenkins-stuff to provide +// killold.killOldBuilds() function: +@Library('tjhei') _ + pipeline { agent none stages { + stage("abort old") + { + agent none + steps + { + // kill older builds in this PR: + script { killold.killOldBuilds() } + } + } + stage("check") { agent diff --git a/contrib/ci/Jenkinsfile.osx b/contrib/ci/Jenkinsfile.osx index 5a404aabb7..68205e5b8b 100644 --- a/contrib/ci/Jenkinsfile.osx +++ b/contrib/ci/Jenkinsfile.osx @@ -19,8 +19,28 @@ Settings to apply inside Jenkins: - discard: 5+ items */ +// load library https://github.com/tjhei/jenkins-stuff to provide +// killold.killOldBuilds() function: +@Library('tjhei') _ + pipeline { + agent none + + stages + { + stage("abort old") + { + agent none + steps + { + // kill older builds in this PR: + script { killold.killOldBuilds() } + } + } + + stage("main") + { agent { node { label 'osx' @@ -95,4 +115,6 @@ pipeline } } } + } + } } diff --git a/contrib/ci/Jenkinsfile.tidy b/contrib/ci/Jenkinsfile.tidy index 82d7e69a39..80ebb236a8 100644 --- a/contrib/ci/Jenkinsfile.tidy +++ b/contrib/ci/Jenkinsfile.tidy @@ -19,8 +19,30 @@ Settings to apply inside Jenkins: - discard: 5+ items */ +// load library https://github.com/tjhei/jenkins-stuff to provide +// killold.killOldBuilds() function: +@Library('tjhei') _ + pipeline { + agent none + + stages + { + stage("abort old") + { + agent none + steps + { + githubNotify context: 'tidy', description: 'initializing...', status: 'PENDING' + // kill older builds in this PR: + script { killold.killOldBuilds() } + } + } + + stage("main") + { + agent { docker @@ -88,4 +110,6 @@ pipeline } } + } + } } -- 2.39.5