Jenkins – abort running build if new one is started

With Jenkins script security many of the solutions here become difficult since they are using non-whitelisted methods. With these milestone steps at the start of the Jenkinsfile, this is working for me: def buildNumber = env.BUILD_NUMBER as int if (buildNumber > 1) milestone(buildNumber – 1) milestone(buildNumber) The result here would be: Build 1 runs and … Read more