Skip to content
This repository was archived by the owner on Sep 23, 2024. It is now read-only.

Commit acc78d0

Browse files
committed
jenkins: Add method to get build status
Allow sktm to retrieve just the build status from a Jenkins job. Signed-off-by: Major Hayden <[email protected]>
1 parent e008677 commit acc78d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sktm/jenkins.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@ def is_build_complete(self, jobname, buildid):
332332

333333
return not build.is_running()
334334

335+
def get_build_status(self, jobname, buildid):
336+
"""Return the status of a Jenkins job."""
337+
job = self.server.get_job(jobname)
338+
build = job.get_build(buildid)
339+
return build.get_status()
340+
335341
def _params_eq(self, build, params):
336342
try:
337343
build_params = build.get_actions()["parameters"]

0 commit comments

Comments
 (0)