public interface SimpleBuildStep extends BuildStep
Builder
or Publisher
) which may be called at an arbitrary time during a build (or multiple times), run, and be done.
Such a build step would typically be written according to some guidelines that ensure it makes few assumptions about how it is being used:
BuildStep.prebuild(hudson.model.AbstractBuild<?, ?>, hudson.model.BuildListener)
, since this presupposes a particular execution order.
BuildStep.getProjectActions(hudson.model.AbstractProject<?, ?>)
, since this might never be called
if the step is not part of the static configuration of a project; instead, add a SimpleBuildStep.LastBuildAction
to a build when run.
BuildStep.getRequiredMonitorService()
to be BuildStepMonitor.NONE
, since this facility
only makes sense for a step called exactly once per build.
DependencyDeclarer
since this would be limited to use in AbstractProject
.
BuildStepDescriptor.isApplicable(java.lang.Class<? extends hudson.model.AbstractProject>)
(there is currently no filtering for other Job
types).
Executor.currentExecutor()
to be non-null, and by extension do not use Computer.currentComputer()
.
BuildStepCompatibilityLayer.perform(AbstractBuild, Launcher, BuildListener)
Modifier and Type | Interface and Description |
---|---|
static interface |
SimpleBuildStep.LastBuildAction
Marker for explicitly added build actions (as
Run.addAction(hudson.model.Action) ) which should imply a transient project
action (Actionable.getActions() ) when present on the Job.getLastSuccessfulBuild() . |
static class |
SimpleBuildStep.LastBuildActionFactory |
BuildStep.PublisherList
BUILDERS, PUBLISHERS
Modifier and Type | Method and Description |
---|---|
void |
perform(Run<?,?> run,
FilePath workspace,
Launcher launcher,
TaskListener listener)
Run this step.
|
getProjectAction, getProjectActions, getRequiredMonitorService, perform, prebuild
void perform(@Nonnull Run<?,?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws InterruptedException, IOException
run
- a build this is running as a part ofworkspace
- a workspace to use for any file operationslauncher
- a way to start processeslistener
- a place to send outputInterruptedException
- if the step is interruptedIOException
- if something goes wrong; use AbortException
for a polite errorCopyright © 2004–2019. All rights reserved.