Last active
August 29, 2015 14:10
-
-
Save sergeyhush/24a716dd4f959d72bd6c to your computer and use it in GitHub Desktop.
Jenkins: Stop upstream job with downstream ones
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jenkins.model.Jenkins | |
def upstreamName = build.buildVariableResolver.resolve("FlushJob") | |
def upstream = Jenkins.instance.getItem(upstreamName) | |
if (upstream) { | |
upstream.getLastBuild().doStop() | |
upstream.getDownstreamProjects().each { it.getLastBuild().doStop() } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment