|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.model.AbstractModelObject
hudson.model.Actionable
hudson.model.Run<JobT,RunT>
@ExportedBean public abstract class Run<JobT extends Job<JobT,RunT>,RunT extends Run<JobT,RunT>>
A particular execution of Job.
Custom Run type is always used in conjunction with a custom
Job type, so there's no separate registration mechanism for custom
Run types.
RunListener| Nested Class Summary | |
|---|---|
class |
Run.Artifact
A build artifact. |
class |
Run.ArtifactList
|
class |
Run.KeepLogBuildBadge
BuildBadgeAction that shows the logs are being kept. |
static class |
Run.RedirectUp
|
static class |
Run.RunnerAbortedException
Used in Runner#run to indicates that a fatal error in a build is
reported to BuildListener and the build should be simply aborted
without further recording a stack trace. |
static class |
Run.Summary
|
| Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
|---|
ExtensionPoint.LegacyInstancesAreScopedToHudson |
| Field Summary | |
|---|---|
static Permission |
ARTIFACTS
See Functions.isArtifactsPermissionEnabled() |
static Permission |
DELETE
|
static FeedAdapter<Run> |
FEED_ADAPTER
FeedAdapter to produce feed from the summary of this build. |
static FeedAdapter<Run> |
FEED_ADAPTER_LATEST
FeedAdapter to produce feeds to show one build per project. |
static int |
LIST_CUTOFF
Maximum number of artifacts to list before using switching to the tree view. |
int |
number
Build number. |
static Comparator<Run> |
ORDER_BY_DATE
Sort by date. |
static PermissionGroup |
PERMISSIONS
|
static int |
TREE_CUTOFF
Maximum number of artifacts to show in tree view before just showing a link. |
static Permission |
UPDATE
|
static com.thoughtworks.xstream.XStream |
XSTREAM
|
| Fields inherited from interface hudson.model.Saveable |
|---|
NOOP |
| Method Summary | ||
|---|---|---|
void |
addAction(Action a)
Adds a new action. |
|
void |
checkPermission(Permission p)
Convenient short-cut for getACL().checkPermission(permission) |
|
int |
compareTo(RunT that)
Ordering based on build numbers. |
|
void |
delete()
Deletes this build and its entire log |
|
void |
deleteArtifacts()
Deletes this build's artifacts. |
|
DirectoryBrowserSupport |
doArtifact()
Serves the artifacts. |
|
void |
doBuildNumber(org.kohsuke.stapler.StaplerResponse rsp)
Returns the build number in the body. |
|
void |
doBuildStatus(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
|
|
void |
doBuildTimestamp(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
String format)
Returns the build time stamp in the body. |
|
org.kohsuke.stapler.HttpResponse |
doConfigSubmit(org.kohsuke.stapler.StaplerRequest req)
|
|
void |
doConsoleText(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Sends out the raw console output. |
|
void |
doDoDelete(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Deletes the build when the button is pressed. |
|
void |
doProgressiveLog(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Deprecated. as of 1.352 Use getLogText().doProgressiveText(req,rsp) |
|
void |
doSubmitDescription(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Accepts the new description. |
|
void |
doToggleLogKeep(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
|
|
static Run<?,?> |
fromExternalizableId(String id)
|
|
String |
getAbsoluteUrl()
Deprecated. This method shall NEVER be used during HTML page rendering, as it won't work with network set up like Apache reverse proxy. This method is only intended for the remote API clients who cannot resolve relative references (even this won't work for the same reason, which should be fixed.) |
|
ACL |
getACL()
Obtains the ACL associated with this object. |
|
Api |
getApi()
|
|
List<Run.Artifact> |
getArtifacts()
Gets the artifacts (relative to getArtifactsDir(). |
|
File |
getArtifactsDir()
Gets the directory where the artifacts are archived. |
|
List<Run.Artifact> |
getArtifactsUpTo(int n)
Gets the first N artifacts. |
|
List<BuildBadgeAction> |
getBadgeActions()
Gets the subset of Actionable.getActions() that consists of
BuildBadgeActions. |
|
Run.Summary |
getBuildStatusSummary()
Gets an object that computes the single line summary of this build. |
|
String |
getBuildStatusUrl()
|
|
|
getCause(Class<T> type)
Returns a Cause of a particular type. |
|
List<Cause> |
getCauses()
Returns the Causes that tirggered a build. |
|
EnvVars |
getCharacteristicEnvVars()
Builds up the environment variable map that's sufficient to identify a process as ours. |
|
Charset |
getCharset()
Gets the charset in which the log file is written. |
|
String |
getDescription()
|
|
Descriptor |
getDescriptorByName(String className)
Exposes all Descriptors by its name to URL. |
|
String |
getDisplayName()
|
|
long |
getDuration()
Gets the millisecond it took to build. |
|
String |
getDurationString()
Gets the string that says how long the build took to run. |
|
Object |
getDynamic(String token,
org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
|
|
EnvVars |
getEnvironment()
Deprecated. as of 1.305 use getEnvironment(TaskListener) |
|
EnvVars |
getEnvironment(TaskListener log)
Returns the map that contains environmental variables to be used for launching processes for this build. |
|
Map<String,String> |
getEnvVars()
Deprecated. as of 1.292 Use getEnvironment() instead. |
|
long |
getEstimatedDuration()
Returns the estimated duration for this run if it is currently running. |
|
Executor |
getExecutor()
Gets the Executor building this job, if it's being built. |
|
String |
getExternalizableId()
|
|
String |
getFullDisplayName()
|
|
String |
getFullName()
|
|
boolean |
getHasArtifacts()
Returns true if this run has any artifacts. |
|
BallColor |
getIconColor()
Gets the icon color for display. |
|
String |
getId()
Unique ID of this build. |
|
static DateFormat |
getIDFormatter()
Get the date formatter used to convert the directory name in to a timestamp This is nasty exposure of private data, but needed all the time the directory containing the build is used as it's timestamp. |
|
String |
getLog()
Deprecated. since 2007-11-11. Use getLog(int) instead as it
avoids loading the whole log into memory unnecessarily. |
|
List<String> |
getLog(int maxLines)
Gets the log of the build as a list of strings (one per log line). |
|
File |
getLogFile()
Returns the log file. |
|
InputStream |
getLogInputStream()
Returns an input stream that reads from the log file. |
|
Reader |
getLogReader()
|
|
AnnotatedLargeText |
getLogText()
Used to URL-bind AnnotatedLargeText. |
|
RunT |
getNextBuild()
|
|
int |
getNumber()
|
|
JobT |
getParent()
The project this build is for. |
|
RunT |
getPreviousBuild()
|
|
RunT |
getPreviousBuildInProgress()
Obtains the next younger build in progress. |
|
List<RunT> |
getPreviousBuildsOverThreshold(int numberOfBuilds,
Result threshold)
Returns the last 'numberOfBuilds' builds with a build result >= 'threshold'. |
|
RunT |
getPreviousBuiltBuild()
Returns the last build that was actually built - i.e., skipping any with Result.NOT_BUILT |
|
RunT |
getPreviousCompletedBuild()
Gets the most recent completed build excluding 'this' Run itself. |
|
RunT |
getPreviousFailedBuild()
Returns the last failed build before this build. |
|
RunT |
getPreviousNotFailedBuild()
Returns the last build that didn't fail before this build. |
|
RunT |
getPreviousSuccessfulBuild()
Returns the last successful build before this build. |
|
Result |
getResult()
Returns the build result. |
|
File |
getRootDir()
Root directory of this Run on the master. |
|
String |
getSearchUrl()
Returns the URL of this item relative to the parent SearchItem. |
|
Date |
getTime()
Same as getTimestamp() but in a different type. |
|
long |
getTimeInMillis()
Same as getTimestamp() but in a different type, that is since
the time of the epoc. |
|
Calendar |
getTimestamp()
When the build is scheduled. |
|
String |
getTimestampString()
Gets the string that says how long since this build has started. |
|
String |
getTimestampString2()
Returns the timestamp formatted in xs:dateTime. |
|
String |
getTruncatedDescription()
Returns the length-limited description. |
|
String |
getUrl()
Returns the URL of this Run, relative to the context root of
Hudson. |
|
String |
getWhyKeepLog()
If isKeepLog() returns true, returns a human readable one-line
string that explains why it's being kept. |
|
boolean |
hasCustomDisplayName()
|
|
boolean |
hasntStartedYet()
Returns true if the build is still queued and hasn't started yet. |
|
boolean |
hasPermission(Permission p)
Convenient short-cut for getACL().hasPermission(permission) |
|
boolean |
isBuilding()
Returns true if the build is not completed yet. |
|
boolean |
isKeepLog()
Returns true if this log file should be kept and not deleted. |
|
boolean |
isLogUpdated()
Returns true if the log file is still being updated. |
|
void |
keepLog()
Marks this build to keep the log. |
|
void |
keepLog(boolean newValue)
|
|
void |
save()
Save the settings to a file. |
|
void |
setDescription(String description)
|
|
void |
setDisplayName(String value)
|
|
void |
setResult(Result r)
|
|
String |
toString()
|
|
void |
writeLogTo(long offset,
org.apache.commons.jelly.XMLOutput out)
Used from console.jelly to write annotated log to the given output. |
|
| Methods inherited from class hudson.model.Actionable |
|---|
getAction, getAction, getActions, getActions |
| Methods inherited from class hudson.model.AbstractModelObject |
|---|
getSearch, getSearchIndex, getSearchName |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int number
In earlier versions < 1.24, this number is not unique nor continuous, but going forward, it will, and this really replaces the build id.
public static final int LIST_CUTOFF
public static final int TREE_CUTOFF
public static final com.thoughtworks.xstream.XStream XSTREAM
public static final Comparator<Run> ORDER_BY_DATE
public static final FeedAdapter<Run> FEED_ADAPTER
FeedAdapter to produce feed from the summary of this build.
public static final FeedAdapter<Run> FEED_ADAPTER_LATEST
FeedAdapter to produce feeds to show one build per project.
public static final PermissionGroup PERMISSIONS
public static final Permission DELETE
public static final Permission UPDATE
public static final Permission ARTIFACTS
Functions.isArtifactsPermissionEnabled()
| Method Detail |
|---|
public void addAction(Action a)
Actionable
addAction in class Actionablepublic int compareTo(RunT that)
compareTo in interface Comparable<RunT extends Run<JobT,RunT>>@Exported public Result getResult()
When a build is in progress, this method
returns an intermediate result.
public void setResult(Result r)
public List<BuildBadgeAction> getBadgeActions()
Actionable.getActions() that consists of
BuildBadgeActions.
@Exported public boolean isBuilding()
public boolean isLogUpdated()
public Executor getExecutor()
Executor building this job, if it's being built.
Otherwise null.
public final Charset getCharset()
public List<Cause> getCauses()
Causes that tirggered a build.
If a build sits in the queue for a long time, multiple build requests made during this period are all rolled up into one build, hence this method may return a list.
public <T extends Cause> T getCause(Class<T> type)
Cause of a particular type.
@Exported public final boolean isKeepLog()
LogRotator.
public String getWhyKeepLog()
isKeepLog() returns true, returns a human readable one-line
string that explains why it's being kept.
public JobT getParent()
@Exported public Calendar getTimestamp()
public final Date getTime()
getTimestamp() but in a different type.
public final long getTimeInMillis()
getTimestamp() but in a different type, that is since
the time of the epoc.
@Exported public String getDescription()
public String getTruncatedDescription()
public String getTimestampString()
public String getTimestampString2()
public String getDurationString()
@Exported public long getDuration()
public BallColor getIconColor()
public boolean hasntStartedYet()
public String toString()
toString in class Objectpublic String getFullName()
@Exported public String getFullDisplayName()
public String getDisplayName()
getDisplayName in interface ModelObjectpublic boolean hasCustomDisplayName()
public void setDisplayName(String value)
throws IOException
value - Set to null to revert back to the default "#NNN".
IOException@Exported(visibility=2) public int getNumber()
public RunT getPreviousBuild()
public final RunT getPreviousCompletedBuild()
public final RunT getPreviousBuildInProgress()
We basically follow the existing skip list, and wherever we find a non-optimal pointer, we remember them in 'fixUp' and update them later.
public RunT getPreviousBuiltBuild()
public RunT getPreviousNotFailedBuild()
public RunT getPreviousFailedBuild()
public RunT getPreviousSuccessfulBuild()
public List<RunT> getPreviousBuildsOverThreshold(int numberOfBuilds,
Result threshold)
numberOfBuilds - the desired number of buildsthreshold - the build result threshold
public RunT getNextBuild()
public String getUrl()
Run, relative to the context root of
Hudson.
@Exported(visibility=2,
name="url")
public final String getAbsoluteUrl()
public final String getSearchUrl()
SearchItemSearchItem.
getSearchUrl in interface SearchItem@Exported public String getId()
public static DateFormat getIDFormatter()
public Descriptor getDescriptorByName(String className)
DescriptorByNameOwnerDescriptors by its name to URL.
Implementation should always delegate to
Hudson.getDescriptorByName(String).
getDescriptorByName in interface DescriptorByNameOwnerclassName - Either Descriptor.getId() (recommended) or the short
name.public File getRootDir()
Run on the master.
Files related to this Run should be stored below this directory.
getRootDir in interface PersistenceRootpublic File getArtifactsDir()
@Exported public List<Run.Artifact> getArtifacts()
getArtifactsDir().
public List<Run.Artifact> getArtifactsUpTo(int n)
public boolean getHasArtifacts()
The strange method name is so that we can access it from EL.
public File getLogFile()
public InputStream getLogInputStream()
throws IOException
IOException
public Reader getLogReader()
throws IOException
IOException
public void writeLogTo(long offset,
org.apache.commons.jelly.XMLOutput out)
throws IOException
IOExceptionpublic AnnotatedLargeText getLogText()
AnnotatedLargeText.
public Api getApi()
public void checkPermission(Permission p)
AccessControlledgetACL().checkPermission(permission)
checkPermission in interface AccessControlledpublic boolean hasPermission(Permission p)
AccessControlledgetACL().hasPermission(permission)
hasPermission in interface AccessControlledpublic ACL getACL()
AccessControlled
getACL in interface AccessControlled
public void deleteArtifacts()
throws IOException
IOException - if we fail to delete.
public void delete()
throws IOException
IOException - if we fail to delete.
public void save()
throws IOException
save in interface SaveableIOException - if the persistence failed.
@Deprecated
public String getLog()
throws IOException
getLog(int) instead as it
avoids loading the whole log into memory unnecessarily.
IOException
public List<String> getLog(int maxLines)
throws IOException
maxLines - The maximum number of log lines to return. If the log is
bigger than this, only the most recent lines are returned.
IOException - If there is a problem reading the log file.
public void doBuildStatus(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException
IOExceptionpublic String getBuildStatusUrl()
public Run.Summary getBuildStatusSummary()
public DirectoryBrowserSupport doArtifact()
public void doBuildNumber(org.kohsuke.stapler.StaplerResponse rsp)
throws IOException
IOException
public void doBuildTimestamp(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
@QueryParameter
String format)
throws IOException
IOException
public void doConsoleText(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException
IOException
public void doProgressiveLog(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException
getLogText().doProgressiveText(req,rsp)
IOException
public void doToggleLogKeep(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException
IOException
javax.servlet.ServletException
@CLIMethod(name="keep-build")
public final void keepLog()
throws IOException
IOException
public void keepLog(boolean newValue)
throws IOException
IOException
public void doDoDelete(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException
IOException
javax.servlet.ServletException
public void setDescription(String description)
throws IOException
IOException
public void doSubmitDescription(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException
IOException
javax.servlet.ServletExceptionpublic Map<String,String> getEnvVars()
getEnvironment() instead.
public EnvVars getEnvironment()
throws IOException,
InterruptedException
getEnvironment(TaskListener)
IOException
InterruptedException
public EnvVars getEnvironment(TaskListener log)
throws IOException,
InterruptedException
BuildSteps that invoke external processes should use this.
This allows BuildWrappers and other project configurations (such
as JDK selection) to take effect.
Unlike earlier getEnvVars(), this map contains the whole
environment, not just the overrides, so one can introspect values to
change its behavior.
IOException
InterruptedExceptionpublic final EnvVars getCharacteristicEnvVars()
ProcessTree.killAll(Map).
public String getExternalizableId()
public static Run<?,?> fromExternalizableId(String id)
public long getEstimatedDuration()
Job.getEstimatedDuration(), may be overridden in
subclasses if duration may depend on run specific parameters (like
incremental Maven builds).
public org.kohsuke.stapler.HttpResponse doConfigSubmit(org.kohsuke.stapler.StaplerRequest req)
throws IOException,
javax.servlet.ServletException,
Descriptor.FormException
IOException
javax.servlet.ServletException
Descriptor.FormException
public Object getDynamic(String token,
org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
getDynamic in class Actionable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||