Skip to content

Instantly share code, notes, and snippets.

@tyuki39
Created March 9, 2011 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyuki39/862308 to your computer and use it in GitHub Desktop.
Save tyuki39/862308 to your computer and use it in GitHub Desktop.
他プロジェクトの指定期間内の成功ビルドの成果物ディレクトリを一覧する方法
// 他プロジェクトの指定期間内の成功ビルドの成果物ディレクトリを一覧する方法
// 以下は 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