hudson.model
Class Build<P extends Project<P,B>,B extends Build<P,B>>

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.model.Run<P,R>
              extended by hudson.model.AbstractBuild<P,B>
                  extended by hudson.model.Build<P,B>
All Implemented Interfaces:
ExtensionPoint, DescriptorByNameOwner, ModelObject, PersistenceRoot, Queue.Executable, Saveable, SearchableModelObject, SearchItem, AccessControlled, Comparable<B>, Runnable, ModelObjectWithContextMenu, OnMaster
Direct Known Subclasses:
FreeStyleBuild, MatrixRun

public abstract class Build<P extends Project<P,B>,B extends Build<P,B>>
extends AbstractBuild<P,B>

A build of a Project.

Steps of a build

Roughly speaking, a Build goes through the following stages:

SCM checkout
Hudson decides which directory to use for a build, then the source code is checked out
Pre-build steps
Everyone gets their BuildStep.prebuild(AbstractBuild, BuildListener) invoked to indicate that the build is starting
Build wrapper set up
BuildWrapper.setUp(AbstractBuild, Launcher, BuildListener) is invoked. This is normally to prepare an environment for the build.
Builder runs
BuildStepCompatibilityLayer.perform(AbstractBuild, Launcher, BuildListener) is invoked. This is where things that are useful to users happen, like calling Ant, Make, etc.
Recorder runs
BuildStepCompatibilityLayer.perform(AbstractBuild, Launcher, BuildListener) is invoked. This is normally to record the output from the build, such as test results.
Notifier runs
BuildStepCompatibilityLayer.perform(AbstractBuild, Launcher, BuildListener) is invoked. This is normally to send out notifications, based on the results determined so far.

And beyond that, the build is considered complete, and from then on Build object is there to keep the record of what happened in this build.

Author:
Kohsuke Kawaguchi

Nested Class Summary
protected  class Build.BuildExecution
           
protected  class Build.RunnerImpl
          Deprecated. as of 1.467 Please use Build.BuildExecution
 
Nested classes/interfaces inherited from class hudson.model.AbstractBuild
AbstractBuild.AbstractBuildExecution, AbstractBuild.AbstractRunner, AbstractBuild.DependencyChange
 
Nested classes/interfaces inherited from class hudson.model.Run
Run.Artifact, Run.ArtifactList, Run.KeepLogBuildBadge, Run.RedirectUp, Run.RunExecution, Run.Runner, Run.RunnerAbortedException, Run.Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.MenuItem
 
Field Summary
 
Fields inherited from class hudson.model.AbstractBuild
buildEnvironments
 
Fields inherited from class hudson.model.Run
ARTIFACTS, charset, DELETE, description, duration, FEED_ADAPTER, FEED_ADAPTER_LATEST, ID_FORMATTER, LIST_CUTOFF, number, ORDER_BY_DATE, PERMISSIONS, project, result, state, timestamp, TREE_CUTOFF, UPDATE, XSTREAM, XSTREAM2
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
protected Build(P project)
          Creates a new build.
protected Build(P job, Calendar timestamp)
           
protected Build(P project, File buildDir)
          Loads a build from a log file.
 
Method Summary
protected  Run.Runner createRunner()
          Deprecated. as of 1.467 Override the run() method by calling Run.execute(RunExecution) with proper execution object.
 void run()
          Invoked by Executor to performs a build.
 
Methods inherited from class hudson.model.AbstractBuild
doStop, doStop, due, getAggregatedTestResultAction, getBuildFingerprints, getBuildVariableResolver, getBuildVariables, getBuiltOn, getBuiltOnStr, getChangeSet, getCulprits, getDependencyChanges, getDownstreamBuilds, getDownstreamBuilds, getDownstreamRelationship, getEnvironment, getEnvironments, getHudsonVersion, getModuleRoot, getModuleRoots, getNextBuild, getPersistentActions, getPreviousBuild, getProject, getRootBuild, getSensitiveBuildVariables, getTestResultAction, getTransitiveUpstreamBuilds, getUpstreamBuilds, getUpstreamRelationship, getUpstreamRelationshipBuild, getUpUrl, getWhyKeepLog, getWorkspace, hasChangeSetComputed, hasParticipant, setBuiltOnStr, setWorkspace
 
Methods inherited from class hudson.model.Run
_this, addAction, canToggleLogKeep, checkPermission, compareTo, delete, deleteArtifacts, doArtifact, doBuildNumber, doBuildStatus, doBuildTimestamp, doConfigSubmit, doConsoleText, doDoDelete, doProgressiveLog, doSubmitDescription, doToggleLogKeep, execute, fromExternalizableId, getAbsoluteUrl, getACL, getApi, getArtifacts, getArtifactsDir, getArtifactsUpTo, getBadgeActions, getBuildStatusSummary, getBuildStatusUrl, getCause, getCauses, getCharacteristicEnvVars, getCharset, getDescription, getDescriptorByName, getDisplayName, getDuration, getDurationString, getDynamic, getEnvironment, getEnvVars, getEstimatedDuration, getExecutor, getExternalizableId, getFullDisplayName, getHasArtifacts, getIconColor, getId, getIDFormatter, getLog, getLog, getLogFile, getLogInputStream, getLogReader, getLogText, getNumber, getOneOffExecutor, getParent, getPreviousBuildInProgress, getPreviousBuildsOverThreshold, getPreviousBuiltBuild, getPreviousCompletedBuild, getPreviousFailedBuild, getPreviousNotFailedBuild, getPreviousSuccessfulBuild, getResult, getRootDir, getSearchUrl, getStartTimeInMillis, getTime, getTimeInMillis, getTimestamp, getTimestampString, getTimestampString2, getTransientActions, getTruncatedDescription, getUrl, hasCustomDisplayName, hasntStartedYet, hasPermission, isBuilding, isKeepLog, isLogUpdated, keepLog, keepLog, makeSearchIndex, onEndBuilding, onLoad, onStartBuilding, reload, run, save, setDescription, setDisplayName, setResult, submit, toString, writeLogTo, writeWholeLogTo
 
Methods inherited from class hudson.model.Actionable
doContextMenu, getAction, getAction, getActions, getActions
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.model.Queue.Executable
getEstimatedDuration, getParent, toString
 

Constructor Detail

Build

protected Build(P project)
         throws IOException
Creates a new build.

Throws:
IOException

Build

protected Build(P job,
                Calendar timestamp)

Build

protected Build(P project,
                File buildDir)
         throws IOException
Loads a build from a log file.

Throws:
IOException
Method Detail

run

public void run()
Description copied from class: AbstractBuild
Invoked by Executor to performs a build.

Specified by:
run in interface Queue.Executable
Specified by:
run in interface Runnable
Specified by:
run in class AbstractBuild<P extends Project<P,B>,B extends Build<P,B>>

createRunner

@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class)
protected Run.Runner createRunner()
Deprecated. as of 1.467 Override the run() method by calling Run.execute(RunExecution) with proper execution object.



Copyright © 2004-2013. All Rights Reserved.