Created
March 8, 2011 15:48
-
-
Save tyuki39/860427 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) | |
def dep = hudson.model.Hudson.instance.dependencyGraph | |
assert job, "ERROR: Can't find the job $jobname." | |
assert dep, "ERROR: Can't get the dependency graph." | |
def downjobs = dep.getDownstream(job) | |
def upjobs = dep.getUpstream(job) | |
println downjobs.name | |
println upjobs.name |
I have found a simpler way to get downstream & upstream jobs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for making my code simpler.