|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Publisher
hudson.tasks.Recorder
hudson.maven.RedeployPublisher
public class RedeployPublisher
Publisher
for MavenModuleSetBuild
to deploy artifacts
after a build is fully succeeded.
Note that the - historical given - name of this class is quite misleading as this publisher usually does no REdeployment
of artifacts. If you're looking for the redeploy functionality in the Jenkins UI: that is implemented in
MavenAbstractArtifactRecord.doRedeploy(String, String, boolean)
!
Nested Class Summary | |
---|---|
static class |
RedeployPublisher.DescriptorImpl
|
static class |
RedeployPublisher.WrappedArtifactRepository
|
Nested classes/interfaces inherited from class hudson.tasks.Publisher |
---|
Publisher.DescriptorExtensionListImpl |
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
ExtensionPoint.LegacyInstancesAreScopedToHudson |
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep |
---|
BuildStep.PublisherList |
Field Summary | |
---|---|
boolean |
evenIfUnstable
|
String |
id
Repository ID. |
String |
releaseEnvVar
|
boolean |
uniqueVersion
|
String |
url
Repository URL to deploy artifacts to. |
Fields inherited from interface hudson.tasks.BuildStep |
---|
BUILDERS, PUBLISHERS |
Constructor Summary | |
---|---|
RedeployPublisher(String id,
String url,
boolean uniqueVersion)
Deprecated. |
|
RedeployPublisher(String id,
String url,
boolean uniqueVersion,
boolean evenIfUnstable)
Deprecated. |
|
RedeployPublisher(String id,
String url,
boolean uniqueVersion,
boolean evenIfUnstable,
String releaseEnvVar)
|
Method Summary | |
---|---|
protected List<MavenAbstractArtifactRecord> |
getActions(AbstractBuild<?,?> build,
BuildListener listener)
|
protected MavenModuleSetBuild |
getMavenBuild(AbstractBuild<?,?> build)
Obtains the MavenModuleSetBuild that we'll work on, or null. |
BuildStepMonitor |
getRequiredMonitorService()
Declares the scope of the synchronization monitor this BuildStep expects from outside. |
protected Result |
getTreshold()
|
boolean |
perform(AbstractBuild<?,?> build,
Launcher launcher,
BuildListener listener)
Runs the step over the given build and reports the progress to the listener. |
Methods inherited from class hudson.tasks.Recorder |
---|
getDescriptor |
Methods inherited from class hudson.tasks.Publisher |
---|
all, getProjectAction, needsToRunAfterFinalized, prebuild |
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer |
---|
getProjectAction, getProjectActions, perform, prebuild |
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 |
---|
getProjectAction, getProjectActions, prebuild |
Field Detail |
---|
public final String id
public final String url
public final boolean uniqueVersion
public final boolean evenIfUnstable
public final String releaseEnvVar
Constructor Detail |
---|
@Deprecated public RedeployPublisher(String id, String url, boolean uniqueVersion)
@Deprecated public RedeployPublisher(String id, String url, boolean uniqueVersion, boolean evenIfUnstable)
@DataBoundConstructor public RedeployPublisher(String id, String url, boolean uniqueVersion, boolean evenIfUnstable, String releaseEnvVar)
Method Detail |
---|
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException
BuildStep
A plugin can contribute the action object to Actionable.getActions()
so that a 'report' becomes a part of the persisted data of Build
.
This is how JUnit plugin attaches the test report to a build page, for example.
perform
in interface BuildStep
perform
in class BuildStepCompatibilityLayer
Using the return value to indicate success/failure should
be considered deprecated, and implementations are encouraged
to throw AbortException
to indicate a failure.
InterruptedException
- If the build is interrupted by the user (in an attempt to abort the build.)
Normally the BuildStep
implementations may simply forward the exception
it got from its lower-level functions.
IOException
- If the implementation wants to abort the processing when an IOException
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 catch IOException
on its own to
provide a better error message, if it can do so, so that users have better
understanding on why it failed.protected MavenModuleSetBuild getMavenBuild(AbstractBuild<?,?> build)
MavenModuleSetBuild
that we'll work on, or null.
This allows promoted-builds plugin to reuse the code for delayed deployment.
protected List<MavenAbstractArtifactRecord> getActions(AbstractBuild<?,?> build, BuildListener listener)
public BuildStepMonitor getRequiredMonitorService()
BuildStep
BuildStep
expects from outside.
This method is introduced for preserving compatibility with plugins written for earlier versions of Hudson, which never run multiple builds of the same job in parallel. Such plugins often assume that the outcome of the previous build is completely available, which is no longer true when we do concurrent builds.
To minimize the necessary code change for such plugins, BuildStep
implementations can request
Hudson to externally perform synchronization before executing them. This behavior is as follows:
BuildStepMonitor.BUILD
BuildStep
is only executed after the previous build is fully
completed (thus fully restoring the earlier semantics of one build at a time.)
BuildStepMonitor.STEP
BuildStep
is only executed after the same step in the previous build is completed.
For build steps that use a weaker assumption and only rely on the output from the same build step of
the early builds, this improves the concurrency.
BuildStepMonitor.NONE
CheckPoint
s
to perform necessary synchronizations.
If you are migrating BuildStep
implementations written for earlier versions of Hudson,
here's what you can do:
BuildStepMonitor.BUILD
to demand the backward compatible behavior from Hudson,
and make no other changes to the code. This will prevent users from reaping the benefits of concurrent
builds, but at least your plugin will work correctly, and therefore this is a good easy first step.
Run.getPreviousBuild()
), then you can return BuildStepMonitor.NONE
without making further
code changes and you are done with migration.
Action
s that you added in the previous build by yourself,
then you only need BuildStepMonitor.STEP
scope synchronization. Return it from this method
,and you are done with migration without any further code changes.
BuildStepMonitor.NONE
and use
CheckPoint
s directly in your code. The general idea is to call CheckPoint.block()
before
you try to access the state from the previous build.
For plugins written against earlier versions of Hudson, calling this method results in
AbstractMethodError
.
protected Result getTreshold()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |