jenkinsflow.utils.set_build_result module

jenkinsflow.utils.set_build_result.set_build_result(result, username, password, direct_url=None, java='java', protocol=<CliProtocol.remoting: 2>)

Change the result of a Jenkins job.

DEPRECATED - You should use the shell step exit code to determine the job result.

Note: set_build_result can only be done from within the job, not after the job has finished. Note: Only available if URL is set in Jenkins system configuration.

This command uses the Jenkins cli to change the result. It requires a java executable to run the Jenkins cli. Please note that in some versions of jenkins the cli is broken, it has no manifest file!

Parameters:
  • result (str) – The result to set. Should probably be ‘unstable’.
  • username (str) – Name of jenkins user with access to the job.
  • password (str) – Password of jenkins user with access to the job.
  • direct-url (str) – Jenkins URL. Default is JENKINS_URL/HUDSON_URL env var value. Use this argument if JENKINS_URL is a proxy.
  • java (str) – Alternative ‘java’ executable.
  • protocol (CliProtocol) – See https://jenkins.io/doc/book/managing/cli/.