Permalink
Browse files

Add get_build convenience function.

A handy shortcut for interactive use, if nothing else.
  • Loading branch information...
1 parent 381335e commit cf109c175b3c65cfcfdb164dca22f73abfe0fd4f @jd-boyd committed Aug 13, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 jenkinsapi/api.py
View
@@ -34,6 +34,14 @@ def get_latest_complete_build(jenkinsurl, jobname):
job = jenkinsci[jobname]
return job.get_last_completed_build()
+def get_build(jenkinsurl, jobname, build_no):
+ """
+ A convenience function to fetch down the test results from a jenkins job by build number.
+ """
+ jenkinsci = Jenkins(jenkinsurl)
+ job = jenkinsci[jobname]
+ return job.get_build( build_no )
+
def get_artifacts( jenkinsurl, jobid=None, build_no=None, proxyhost=None, proxyport=None, proxyuser=None, proxypass=None ):
"""
Find all the artifacts for the latest build of a job.

0 comments on commit cf109c1

Please sign in to comment.