Package hudson.model
Class Build<P extends Project<P,B>,B extends Build<P,B>>
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.Run<P,R>
-
- hudson.model.AbstractBuild<P,B>
-
- hudson.model.Build<P,B>
-
- All Implemented Interfaces:
ExtensionPoint
,DescriptorByNameOwner
,ModelObject
,PersistenceRoot
,Queue.Executable
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Comparable<B>
,Runnable
,LazyBuildMixIn.LazyLoadingRun<P,B>
,ModelObjectWithContextMenu
,RunWithSCM<P,B>
,OnMaster
,org.kohsuke.stapler.StaplerProxy
- Direct Known Subclasses:
FreeStyleBuild
public abstract class Build<P extends Project<P,B>,B extends Build<P,B>> extends AbstractBuild<P,B>
A build of aProject
.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
Nested Classes Modifier and Type Class Description protected class
Build.BuildExecution
protected class
Build.RunnerImpl
Deprecated.as of 1.467 Please useBuild.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.StatusSummarizer, Run.Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
-
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, LIST_CUTOFF, nextBuild, number, ORDER_BY_DATE, PERMISSIONS, previousBuild, project, QUEUE_ID_UNKNOWN, result, SKIP_PERMISSION_CHECK, timestamp, TREE_CUTOFF, UPDATE, XSTREAM, XSTREAM2
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Run.Runner
createRunner()
Deprecated.as of 1.467 Override therun()
method by callingRun.execute(hudson.model.Run.RunExecution)
with proper execution object.void
run()
Invoked byExecutor
to performs a build.-
Methods inherited from class hudson.model.AbstractBuild
addAction, calculateCulprits, createReference, doStop, doStop, dropLinks, due, getAggregatedTestResultAction, getBuildVariableResolver, getBuildVariables, getBuiltOn, getBuiltOnStr, getChangeSet, getChangeSets, getCulpritIds, getCulprits, getDependencyChanges, getDownstreamBuilds, getDownstreamBuilds, getDownstreamRelationship, getEnvironment, getEnvironments, getHudsonVersion, getModuleRoot, getModuleRoots, getNextBuild, getParentExecutable, getPersistentActions, getPreviousBuild, getProject, getRootBuild, getRunMixIn, getSensitiveBuildVariables, getTestResultAction, getTransitiveUpstreamBuilds, getUpstreamBuilds, getUpstreamRelationship, getUpstreamRelationshipBuild, getUpUrl, getWhyKeepLog, getWorkspace, hasChangeSetComputed, setBuiltOnStr, setWorkspace, shouldCalculateCulprits
-
Methods inherited from class hudson.model.Run
_this, canToggleLogKeep, compareTo, delete, deleteArtifacts, doArtifact, doBuildNumber, doBuildStatus, doBuildTimestamp, doConfigSubmit, doConsoleText, doDoDelete, doProgressiveLog, doSubmitDescription, doToggleLogKeep, execute, fromExternalizableId, getAbsoluteUrl, getACL, getApi, getArtifactManager, getArtifacts, getArtifactsDir, getArtifactsUpTo, getBadgeActions, getBuildFingerprints, getBuildsOverThreshold, getBuildStatusIconClassName, getBuildStatusSummary, getBuildStatusUrl, getCause, getCauses, getCharacteristicEnvVars, getCharset, getDescription, getDisplayName, getDuration, getDurationString, getDynamic, getEnvironment, getEnvVars, getEstimatedDuration, getExecutor, getExternalizableId, getFullDisplayName, getHasArtifacts, getIconColor, getId, getLog, getLog, getLogFile, getLogInputStream, getLogReader, getLogText, getNumber, getOneOffExecutor, getParent, getPreviousBuildInProgress, getPreviousBuildsOverThreshold, getPreviousBuiltBuild, getPreviousCompletedBuild, getPreviousFailedBuild, getPreviousNotFailedBuild, getPreviousSuccessfulBuild, getQueueId, getResult, getRootDir, getSearchUrl, getStartTimeInMillis, getTarget, getTime, getTimeInMillis, getTimestamp, getTimestampString, getTimestampString2, getTransientActions, getTruncatedDescription, getUrl, hasCustomDisplayName, hasntStartedYet, isBuilding, isInProgress, isKeepLog, isLogUpdated, keepLog, keepLog, makeSearchIndex, onEndBuilding, onLoad, onStartBuilding, pickArtifactManager, reload, run, save, setDescription, setDisplayName, setQueueId, setResult, submit, toString, updateSymlinks, writeLogTo, writeReplace, writeWholeLogTo
-
Methods inherited from class hudson.model.Actionable
addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActions
-
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, wait, wait, wait
-
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
-
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
-
Methods inherited from interface hudson.model.Queue.Executable
getEstimatedDuration, getParent, toString
-
Methods inherited from interface jenkins.scm.RunWithSCM
hasParticipant
-
-
-
-
Constructor Detail
-
Build
protected Build(P project) throws IOException
Creates a new build.- Throws:
IOException
-
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 byExecutor
to performs a build.
-
createRunner
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Deprecated protected Run.Runner createRunner()
Deprecated.as of 1.467 Override therun()
method by callingRun.execute(hudson.model.Run.RunExecution)
with proper execution object.
-
-