Created
March 9, 2011 14:51
-
-
Save tyuki39/862308 to your computer and use it in GitHub Desktop.
他プロジェクトの指定期間内の成功ビルドの成果物ディレクトリを一覧する方法
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
// 他プロジェクトの指定期間内の成功ビルドの成果物ディレクトリを一覧する方法 | |
// 以下は groovy plugin の Execute system Groovy script の中で使用して | |
// TESTプロジェクトの | |
// 2011/3/1 00:00:00 から | |
// TESTプロジェクトの最終ビルド まで | |
// の期間を対象にして成功ビルドの成果物ディレクトリを一覧する | |
def jobname = "TEST" | |
def job = hudson.model.Hudson.instance.getItem(jobname) | |
assert job, "ERROR: Can't find the job $jobname." | |
def start = new GregorianCalendar(2011,2,1,0,0,0) | |
def end = job.lastBuild.timestamp | |
job.builds.byTimestamp(start.timeInMillis, end.timeInMillis + 1).each { | |
if( it.result == hudson.model.Result.SUCCESS ) { | |
println it.artifactsDir | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment