From: Joshua Boyd Date: Mon, 13 Aug 2012 22:45:05 +0000 (-0300) Subject: Add get_build convenience function. X-Git-Tag: v0.2.23~272^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf109c175b3c65cfcfdb164dca22f73abfe0fd4f;p=tools%2Fpython-jenkinsapi.git Add get_build convenience function. A handy shortcut for interactive use, if nothing else. --- diff --git a/jenkinsapi/api.py b/jenkinsapi/api.py index a906288..1186a33 100644 --- a/jenkinsapi/api.py +++ b/jenkinsapi/api.py @@ -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.