Jenkins currentBuild: Difference between revisions
Line 28: | Line 28: | ||
==<tt></tt>== | ==<tt></tt>== | ||
=Methods= | =Methods= | ||
==<tt></tt>== | ==<tt>resultIsBetterOrEqualTo(String)</tt>== | ||
Compares the current build result to the provided result string (SUCCESS, UNSTABLE, or FAILURE) and returns true if the current build result is better than or equal to the provided result. | |||
==<tt> resultIsWorseOrEqualTo(String)</tt>== | |||
Compares the current build result to the provided result string (SUCCESS, UNSTABLE, or FAILURE) and returns true if the current build result is worse than or equal to the provided result. |
Revision as of 04:31, 8 May 2021
Internal
Overview
currentBuild
is a global variable that may be used to refer to the currently running build. It has the following properties and methods.
Properties
number
The build number, which is an integer.
result
Typically "SUCCESS", "UNSTABLE" or "FAILURE". May be null for an ongoing build. The property is writable.
currentResult
Typically "SUCCESS", "UNSTABLE" or "FAILURE". Is never null. If no failure occurred, the result is "SUCCESS".
Methods
resultIsBetterOrEqualTo(String)
Compares the current build result to the provided result string (SUCCESS, UNSTABLE, or FAILURE) and returns true if the current build result is better than or equal to the provided result.
resultIsWorseOrEqualTo(String)
Compares the current build result to the provided result string (SUCCESS, UNSTABLE, or FAILURE) and returns true if the current build result is worse than or equal to the provided result.