Class ArtifactArchiver
- All Implemented Interfaces:
ExtensionPoint,Describable<Publisher>,BuildStep,SimpleBuildStep
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classNested classes/interfaces inherited from class hudson.tasks.Publisher
Publisher.DescriptorExtensionListImplNested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherListNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.as of 1.286 Some plugin depends on this, so this field is left here and points to the last created instance.Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS -
Constructor Summary
ConstructorsConstructorDescriptionArtifactArchiver(String artifacts) ArtifactArchiver(String artifacts, String excludes, boolean latestOnly) Deprecated.ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, boolean allowEmptyArchive) Deprecated.ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, boolean allowEmptyArchive, boolean onlyIfSuccessful) Deprecated.ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, boolean allowEmptyArchive, boolean onlyIfSuccessful, Boolean defaultExcludes) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeclares the scope of the synchronization monitor thisBuildStepexpects from outside.booleanbooleanbooleanbooleanbooleanDeprecated.booleanvoidRun this step.protected Objectfinal voidsetAllowEmptyArchive(boolean allowEmptyArchive) final voidsetCaseSensitive(boolean caseSensitive) final voidsetDefaultExcludes(boolean defaultExcludes) final voidsetExcludes(String excludes) voidsetFingerprint(boolean fingerprint) Whether to fingerprint the artifacts after we archive them.final voidsetFollowSymlinks(boolean followSymlinks) final voidsetOnlyIfSuccessful(boolean onlyIfSuccessful) Methods inherited from class hudson.tasks.Recorder
getDescriptorMethods inherited from class hudson.tasks.Publisher
all, getProjectAction, needsToRunAfterFinalized, prebuildMethods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectActions, perform, perform, prebuildMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, perform, prebuildMethods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
Field Details
-
DESCRIPTOR
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static volatile ArtifactArchiver.DescriptorImpl DESCRIPTORDeprecated.as of 1.286 Some plugin depends on this, so this field is left here and points to the last created instance. UseJenkins.getDescriptorByType(Class)instead.
-
-
Constructor Details
-
ArtifactArchiver
-
ArtifactArchiver
Deprecated. -
ArtifactArchiver
@Deprecated public ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, boolean allowEmptyArchive) Deprecated. -
ArtifactArchiver
@Deprecated public ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, boolean allowEmptyArchive, boolean onlyIfSuccessful) Deprecated. -
ArtifactArchiver
@Deprecated public ArtifactArchiver(String artifacts, String excludes, boolean latestOnly, boolean allowEmptyArchive, boolean onlyIfSuccessful, Boolean defaultExcludes) Deprecated.
-
-
Method Details
-
readResolve
-
getArtifacts
-
getExcludes
-
setExcludes
-
isLatestOnly
Deprecated. -
isOnlyIfSuccessful
public boolean isOnlyIfSuccessful() -
setOnlyIfSuccessful
@DataBoundSetter public final void setOnlyIfSuccessful(boolean onlyIfSuccessful) -
isFingerprint
public boolean isFingerprint() -
setFingerprint
@DataBoundSetter public void setFingerprint(boolean fingerprint) Whether to fingerprint the artifacts after we archive them. -
getAllowEmptyArchive
public boolean getAllowEmptyArchive() -
setAllowEmptyArchive
@DataBoundSetter public final void setAllowEmptyArchive(boolean allowEmptyArchive) -
isDefaultExcludes
public boolean isDefaultExcludes() -
setDefaultExcludes
@DataBoundSetter public final void setDefaultExcludes(boolean defaultExcludes) -
isCaseSensitive
public boolean isCaseSensitive() -
setCaseSensitive
@DataBoundSetter public final void setCaseSensitive(boolean caseSensitive) -
isFollowSymlinks
public boolean isFollowSymlinks() -
setFollowSymlinks
@DataBoundSetter public final void setFollowSymlinks(boolean followSymlinks) -
perform
public void perform(Run<?, ?> build, FilePath ws, EnvVars environment, Launcher launcher, TaskListener listener) throws IOException, InterruptedExceptionDescription copied from interface:SimpleBuildStepRun this step.This method must be overridden when this step requires a workspace context. If such a context is not required, it does not need to be overridden; it will then forward to
SimpleBuildStep.perform(Run, EnvVars, TaskListener).- Specified by:
performin interfaceSimpleBuildStep- Parameters:
build- a build this is running as a part ofws- a workspace to use for any file operationsenvironment- environment variables applicable to this steplauncher- a way to start processeslistener- a place to send output- Throws:
IOException- if something goes wrong; useAbortExceptionfor a polite errorInterruptedException- if the step is interrupted
-
getRequiredMonitorService
Description copied from interface:BuildStepDeclares the scope of the synchronization monitor thisBuildStepexpects 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,
BuildStepimplementations can request Hudson to externally perform synchronization before executing them. This behavior is as follows:BuildStepMonitor.BUILD-
This
BuildStepis only executed after the previous build is fully completed (thus fully restoring the earlier semantics of one build at a time.) BuildStepMonitor.STEP-
This
BuildStepis 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-
No external synchronization is performed on this build step. This is the most efficient, and thus
the recommended value for newer plugins. Wherever necessary, you can directly use
CheckPoints to perform necessary synchronizations.
Migrating Older Implementations: If you are migrating
BuildStepimplementations written for earlier versions of Hudson, here's what you can do:- To demand the backward compatible behavior from Jenkins, leave this method unoverridden, 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.
-
If your build step doesn't use anything from a previous build (for example, if you don't even call
Run.getPreviousBuild()), then you can returnBuildStepMonitor.NONEwithout making further code changes and you are done with migration. -
If your build step only depends on
Actions that you added in the previous build by yourself, then you only needBuildStepMonitor.STEPscope synchronization. Return it from this method ,and you are done with migration without any further code changes. -
If your build step makes more complex assumptions, return
BuildStepMonitor.NONEand useCheckPoints directly in your code. The general idea is to callCheckPoint.block()before you try to access the state from the previous build.
- Specified by:
getRequiredMonitorServicein interfaceBuildStep
-