Class RunWrapper
- java.lang.Object
-
- org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper
-
- All Implemented Interfaces:
Serializable
public final class RunWrapper extends Object implements Serializable
AllowsWhitelisted
access to selected attributes of aRun
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RunWrapper(Run<?,?> build, boolean currentBuild)
-
Method Summary
-
-
-
Constructor Detail
-
RunWrapper
public RunWrapper(Run<?,?> build, boolean currentBuild)
-
-
Method Detail
-
getRawBuild
@CheckForNull public Run<?,?> 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
public void setResult(String result) throws AbortException
- Throws:
AbortException
-
setDescription
public void setDescription(String d) throws IOException
- Throws:
IOException
-
setDisplayName
public void setDisplayName(String n) throws IOException
- Throws:
IOException
-
setKeepLog
public void setKeepLog(boolean b) throws IOException
- Throws:
IOException
-
getNumber
public int getNumber() throws AbortException
- Throws:
AbortException
-
getBuildCauses
public net.sf.json.JSONArray getBuildCauses() throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
getBuildCauses
public net.sf.json.JSONArray getBuildCauses(String className) throws IOException
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
@CheckForNull public String getResult() throws AbortException
- Throws:
AbortException
-
getCurrentResult
@NonNull public String getCurrentResult() throws AbortException
- Throws:
AbortException
-
resultIsBetterOrEqualTo
public boolean resultIsBetterOrEqualTo(String other) throws AbortException
- Throws:
AbortException
-
resultIsWorseOrEqualTo
public boolean resultIsWorseOrEqualTo(String other) throws AbortException
- Throws:
AbortException
-
getTimeInMillis
public long getTimeInMillis() throws AbortException
- Throws:
AbortException
-
getStartTimeInMillis
public long getStartTimeInMillis() throws AbortException
- Throws:
AbortException
-
getDuration
public long getDuration() throws AbortException
- Throws:
AbortException
-
getDurationString
public String getDurationString() throws AbortException
- Throws:
AbortException
-
getDescription
public String getDescription() throws AbortException
- Throws:
AbortException
-
getDisplayName
public String getDisplayName() throws AbortException
- Throws:
AbortException
-
getFullDisplayName
public String getFullDisplayName() throws AbortException
- Throws:
AbortException
-
isKeepLog
public boolean isKeepLog() throws AbortException
- Throws:
AbortException
-
getProjectName
public String getProjectName() throws AbortException
- Throws:
AbortException
-
getFullProjectName
public String getFullProjectName() throws AbortException
- Throws:
AbortException
-
getPreviousBuild
@CheckForNull public RunWrapper getPreviousBuild() throws AbortException
- Throws:
AbortException
-
getPreviousBuildInProgress
@CheckForNull public RunWrapper getPreviousBuildInProgress() throws AbortException
- Throws:
AbortException
-
getPreviousBuiltBuild
@CheckForNull public RunWrapper getPreviousBuiltBuild() throws AbortException
- Throws:
AbortException
-
getPreviousCompletedBuild
@CheckForNull public RunWrapper getPreviousCompletedBuild() throws AbortException
- Throws:
AbortException
-
getPreviousFailedBuild
@CheckForNull public RunWrapper getPreviousFailedBuild() throws AbortException
- Throws:
AbortException
-
getPreviousNotFailedBuild
@CheckForNull public RunWrapper getPreviousNotFailedBuild() throws AbortException
- Throws:
AbortException
-
getPreviousSuccessfulBuild
@CheckForNull public RunWrapper getPreviousSuccessfulBuild() throws AbortException
- Throws:
AbortException
-
getNextBuild
@CheckForNull public RunWrapper getNextBuild() throws AbortException
- Throws:
AbortException
-
getId
public String getId() throws AbortException
- Throws:
AbortException
-
getBuildVariables
@NonNull public Map<String,String> getBuildVariables() throws AbortException
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
@NonNull public List<RunWrapper> getUpstreamBuilds() throws AbortException
- Throws:
AbortException
-
getAbsoluteUrl
@NonNull public String getAbsoluteUrl() throws AbortException
- Throws:
AbortException
-
getChangeSets
public List<ChangeLogSet<? extends ChangeLogSet.Entry>> getChangeSets() throws Exception
- Throws:
Exception
-
-