Package hudson.model

Class Build<P extends Project<P,B>,B extends Build<P,B>>

All Implemented Interfaces:
ExtensionPoint, DescriptorByNameOwner, ModelObject, PersistenceRoot, Queue.Executable, Saveable, SearchableModelObject, SearchItem, AccessControlled, Comparable<B>, Runnable, WithConsoleUrl, HistoricalBuild, 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 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