Class RunWrapper
java.lang.Object
org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper
- All Implemented Interfaces:
Serializable
Allows
Whitelisted
access to selected attributes of a Run
without requiring Jenkins API imports.
See the help for currentBuild in snippet-generator's globals list for
details on these fields.
NOTE: if modifying this class, please remember to manually update Runwrapper/help.html- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.sf.json.JSONArray
net.sf.json.JSONArray
getBuildCauses
(String className) Filters the returned list by the type ofCause
class passed as input ex.Get environment variables defined in the build.List<ChangeLogSet<? extends ChangeLogSet.Entry>>
long
getId()
int
Run<?,
?> Raw access to the internal build object.long
long
boolean
boolean
resultIsBetterOrEqualTo
(String other) boolean
resultIsWorseOrEqualTo
(String other) void
void
void
setKeepLog
(boolean b) void
-
Constructor Details
-
RunWrapper
-
-
Method Details
-
getRawBuild
Raw access to the internal build object. Intentionally notWhitelisted
. The result is also not cached, since we want to stop allowing access to a build after it has been deleted. -
setResult
- Throws:
AbortException
-
setDescription
- Throws:
IOException
-
setDisplayName
- Throws:
IOException
-
setKeepLog
- Throws:
IOException
-
getNumber
- Throws:
AbortException
-
getBuildCauses
- Throws:
IOException
ClassNotFoundException
-
getBuildCauses
Filters the returned list by the type ofCause
class passed as input ex.getBuildCauses('hudson.model.Cause$UserIdCause')
would return onlyCause
s of that type- Parameters:
className
- A string containing the fully qualified name for the class type to filter the result list by- Returns:
- a
JSONArray
ofCause
s of the specified type - Throws:
IOException
-
getResult
- Throws:
AbortException
-
getCurrentResult
- Throws:
AbortException
-
resultIsBetterOrEqualTo
- Throws:
AbortException
-
resultIsWorseOrEqualTo
- Throws:
AbortException
-
getTimeInMillis
- Throws:
AbortException
-
getStartTimeInMillis
- Throws:
AbortException
-
getDuration
- Throws:
AbortException
-
getDurationString
- Throws:
AbortException
-
getDescription
- Throws:
AbortException
-
getDisplayName
- Throws:
AbortException
-
getFullDisplayName
- Throws:
AbortException
-
isKeepLog
- Throws:
AbortException
-
getProjectName
- Throws:
AbortException
-
getFullProjectName
- Throws:
AbortException
-
getPreviousBuild
- Throws:
AbortException
-
getPreviousBuildInProgress
- Throws:
AbortException
-
getPreviousBuiltBuild
- Throws:
AbortException
-
getPreviousCompletedBuild
- Throws:
AbortException
-
getPreviousFailedBuild
- Throws:
AbortException
-
getPreviousNotFailedBuild
- Throws:
AbortException
-
getPreviousSuccessfulBuild
- Throws:
AbortException
-
getNextBuild
- Throws:
AbortException
-
getId
- Throws:
AbortException
-
getExternalizableId
-
getBuildVariables
Get environment variables defined in the build. This does not report build parameters for parameterised builds, only the build environment. If a child job is a Pipeline job (WorkflowRun), any variables set during script execution are captured and reported.- Throws:
AbortException
-
getUpstreamBuilds
- Throws:
AbortException
-
getAbsoluteUrl
- Throws:
AbortException
-
getChangeSets
- Throws:
Exception
-