From 9dcddc556684dfe060acf47c948fff10eb28c5c9 Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 6 Apr 2023 15:12:06 +0200 Subject: [PATCH] chore(jenkins): cancel older jobs --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 7ba8c26..3bc73e8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,6 +10,16 @@ pipeline { } stages { + stage('Cancel older jobs') { + steps { + script { + def buildNumber = env.BUILD_NUMBER as int + if (buildNumber > 1) milestone(buildNumber - 1) + milestone(buildNumber) + } + } + } + stage('Run unit tests') { steps { script {