public abstract class AbstractBuild.AbstractBuildExecution extends Run.Runner
| Modifier and Type | Field and Description |
|---|---|
protected Launcher |
launcher
Since configuration can be changed while a build is in progress,
create a launcher once and stick to it for the entire build duration.
|
protected BuildListener |
listener
Output/progress of this build goes here.
|
| Constructor and Description |
|---|
AbstractBuildExecution() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp(BuildListener listener)
Performs final clean up action.
|
protected Launcher |
createLauncher(BuildListener listener)
Creates a
Launcher that this build will use. |
protected WorkspaceList.Lease |
decideWorkspace(Node n,
WorkspaceList wsl)
Allocates the workspace from
WorkspaceList. |
void |
defaultCheckout() |
protected abstract Result |
doRun(BuildListener listener)
The portion of a build that is specific to a subclass of
AbstractBuild
goes here. |
protected Node |
getCurrentNode()
Returns the current
Node on which we are building. |
Launcher |
getLauncher() |
BuildListener |
getListener() |
protected boolean |
perform(BuildStep bs,
BuildListener listener)
Calls a build step.
|
protected void |
performAllBuildStep(BuildListener listener,
Iterable<? extends BuildStep> buildSteps,
boolean phase)
Deprecated.
as of 1.356
Use
performAllBuildSteps(BuildListener, Iterable, boolean) |
protected void |
performAllBuildStep(BuildListener listener,
Map<?,? extends BuildStep> buildSteps,
boolean phase)
Deprecated.
as of 1.356
Use
performAllBuildSteps(BuildListener, Map, boolean) |
protected boolean |
performAllBuildSteps(BuildListener listener,
Iterable<? extends BuildStep> buildSteps,
boolean phase)
Runs all the given build steps, even if one of them fail.
|
protected boolean |
performAllBuildSteps(BuildListener listener,
Map<?,? extends BuildStep> buildSteps,
boolean phase) |
void |
post(BuildListener listener)
Performs the post-build action.
|
protected abstract void |
post2(BuildListener listener) |
protected boolean |
preBuild(BuildListener listener,
Collection<? extends BuildStep> steps) |
protected boolean |
preBuild(BuildListener listener,
Iterable<? extends BuildStep> steps) |
protected boolean |
preBuild(BuildListener listener,
Map<?,? extends BuildStep> steps) |
Result |
run(BuildListener listener)
Performs the main build and returns the status code.
|
getAttributes, getBuild, getProjectprotected Launcher launcher
protected BuildListener listener
@Nonnull protected final Node getCurrentNode() throws IllegalStateException
Node on which we are building.NodeIllegalStateException - if that cannot be determinedpublic Launcher getLauncher()
public BuildListener getListener()
protected WorkspaceList.Lease decideWorkspace(@Nonnull Node n, WorkspaceList wsl) throws InterruptedException, IOException
WorkspaceList.n - Passed in for the convenience. The node where the build is running.wsl - Passed in for the convenience. The returned path must be registered to this object.InterruptedExceptionIOExceptionpublic Result run(@Nonnull BuildListener listener) throws Exception
Run.RunExecutionrun in class Run.RunExecutionException - exception will be recorded and the build will be considered a failure.@Nonnull protected Launcher createLauncher(@Nonnull BuildListener listener) throws IOException, InterruptedException
Launcher that this build will use. This can be overridden by derived types
to decorate the resulting Launcher.listener - Always non-null. Connected to the main build output.IOExceptionInterruptedExceptionpublic void defaultCheckout()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionprotected abstract Result doRun(BuildListener listener) throws Exception, Run.RunnerAbortedException
AbstractBuild
goes here.ExceptionRun.RunnerAbortedExceptionprotected abstract void post2(BuildListener listener) throws Exception
Exceptionpost(BuildListener)public final void post(BuildListener listener) throws Exception
Run.RunExecution
This method is called after the main portion of the build is completed.
This is a good opportunity to do notifications based on the result
of the build. When this method is called, the build is not really
finalized yet, and the build is still considered in progress --- for example,
even if the build is successful, this build still won't be picked up
by Job.getLastSuccessfulBuild().
post in class Run.RunExecutionExceptionpublic void cleanUp(BuildListener listener) throws Exception
Run.RunExecution
This method is called after Run.RunExecution.post(BuildListener),
after the build result is fully finalized. This is the point
where the build is already considered completed.
Among other things, this is often a necessary pre-condition before invoking other builds that depend on this build.
cleanUp in class Run.RunExecutionException@Deprecated protected final void performAllBuildStep(BuildListener listener, Map<?,? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException
performAllBuildSteps(BuildListener, Map, boolean)InterruptedExceptionIOExceptionprotected final boolean performAllBuildSteps(BuildListener listener, Map<?,? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException
InterruptedExceptionIOException@Deprecated protected final void performAllBuildStep(BuildListener listener, Iterable<? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException
performAllBuildSteps(BuildListener, Iterable, boolean)InterruptedExceptionIOExceptionprotected final boolean performAllBuildSteps(BuildListener listener, Iterable<? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException
phase - true for the post build processing, and false for the final "run after finished" execution.InterruptedExceptionIOExceptionprotected final boolean perform(BuildStep bs, BuildListener listener) throws InterruptedException, IOException
InterruptedExceptionIOExceptionprotected final boolean preBuild(BuildListener listener, Map<?,? extends BuildStep> steps)
protected final boolean preBuild(BuildListener listener, Collection<? extends BuildStep> steps)
protected final boolean preBuild(BuildListener listener, Iterable<? extends BuildStep> steps)
Copyright © 2019. All rights reserved.