From cf109c175b3c65cfcfdb164dca22f73abfe0fd4f Mon Sep 17 00:00:00 2001 From: Joshua Boyd Date: Mon, 13 Aug 2012 19:45:05 -0300 Subject: [PATCH] Add get_build convenience function. A handy shortcut for interactive use, if nothing else. --- jenkinsapi/api.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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. -- 2.7.4