Created
March 8, 2011 14:59
-
-
Save tyuki39/860367 to your computer and use it in GitHub Desktop.
Jenkinsで他のプロジェクトのビルドを中止する方法
This file contains hidden or 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
// 他のプロジェクトのビルドを中止する方法 | |
// 以下は groovy plugin の Execute system Groovy script の中で使用して | |
// TEST プロジェクトのビルドを中止する例 | |
def jobname = "TEST" | |
def job = hudson.model.Hudson.instance.getItem(jobname) | |
assert job, "ERROR: Can't find the job $jobname." | |
def lastbuild = job.lastBuild | |
if( lastbuild ) { | |
def executor = lastbuild.executor | |
if( executor ) { | |
executor.interrupt() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment