Class BuildStepCompatibilityLayer
- All Implemented Interfaces:
BuildStep
BuildStep
before 1.150
so that old plugin binaries can continue to function with new Hudson.- Since:
- 1.150
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Field Summary
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetProjectAction
(AbstractProject<?, ?> project) Deprecated.getProjectAction
(Project<?, ?> project) Deprecated.UsegetProjectAction(AbstractProject)
instead.Collection<? extends Action>
getProjectActions
(AbstractProject<?, ?> project) boolean
perform
(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) Deprecated.Runs the step over the given build and reports the progress to the listener.boolean
perform
(Build<?, ?> build, Launcher launcher, BuildListener listener) Deprecated.Useperform(AbstractBuild, Launcher, BuildListener)
instead.boolean
prebuild
(AbstractBuild<?, ?> build, BuildListener listener) Deprecated.Runs before the build begins.boolean
prebuild
(Build<?, ?> build, BuildListener listener) Deprecated.Useprebuild(AbstractBuild, BuildListener)
instead.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hudson.tasks.BuildStep
getRequiredMonitorService
-
Constructor Details
-
BuildStepCompatibilityLayer
public BuildStepCompatibilityLayer()Deprecated.
-
-
Method Details
-
prebuild
Deprecated.Description copied from interface:BuildStep
Runs before the build begins.- Specified by:
prebuild
in interfaceBuildStep
- Returns:
- true if the build can continue, false if there was an error
and the build needs to be aborted.
Using the return value to indicate success/failure should be considered deprecated, and implementations are encouraged to throw
AbortException
to indicate a failure.
-
perform
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOExceptionDeprecated.Description copied from interface:BuildStep
Runs the step over the given build and reports the progress to the listener.A plugin can contribute the action object to
Actionable.getActions()
so that a 'report' becomes a part of the persisted data ofBuild
. This is how JUnit plugin attaches the test report to a build page, for example.When this build step needs to make (direct or indirect) permission checks to
ACL
(for example, to locate other projects by name, build them, or access their artifacts) then it must be run under a specificAuthentication
. In such a case, the implementation should check whetherJenkins.getAuthentication2()
isACL.SYSTEM2
, and if so, replace it for the duration of this step withJenkins.ANONYMOUS
. (Either usingACL.impersonate2(org.springframework.security.core.Authentication)
, or by making explicit calls toACL.hasPermission2(Authentication, Permission)
.) This would typically happen when noQueueItemAuthenticator
was available, configured, and active.- Specified by:
perform
in interfaceBuildStep
- Returns:
- Delegates to
SimpleBuildStep.perform(Run, FilePath, Launcher, TaskListener)
if possible, always returning true or throwing an error. - Throws:
InterruptedException
- If the build is interrupted by the user (in an attempt to abort the build.) Normally theBuildStep
implementations may simply forward the exception it got from its lower-level functions.IOException
- If the implementation wants to abort the processing when anIOException
happens, it can simply propagate the exception to the caller. This will cause the build to fail, with the default error message. Implementations are encouraged to catchIOException
on its own to provide a better error message, if it can do so, so that users have better understanding on why it failed.
-
getProjectAction
Deprecated.- Specified by:
getProjectAction
in interfaceBuildStep
-
getProjectActions
Deprecated.Description copied from interface:BuildStep
Returns action objects if thisBuildStep
has actions to contribute to aProject
.Project
calls this method for everyBuildStep
that it owns when the rendering is requested.This action can have optional
jobMain.jelly
view, which will be aggregated into the main panel of the job top page. The jelly file should have an<h2>
tag that shows the section title, followed by some block elements to render the details of the section.- Specified by:
getProjectActions
in interfaceBuildStep
- Parameters:
project
-Project
that owns this build step, sinceBuildStep
object doesn't usually have this "parent" pointer.- Returns:
- can be empty but never null.
-
prebuild
Deprecated.Useprebuild(AbstractBuild, BuildListener)
instead. -
perform
@Deprecated public boolean perform(Build<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOExceptionDeprecated.Useperform(AbstractBuild, Launcher, BuildListener)
instead.- Throws:
InterruptedException
IOException
-
getProjectAction
Deprecated.UsegetProjectAction(AbstractProject)
instead.
-