Class ClassicUploadStep
java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Builder
com.google.jenkins.plugins.storage.ClassicUploadStep
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
,Serializable
,SimpleBuildStep
@RequiresDomain(StorageScopeRequirement.class)
public class ClassicUploadStep
extends Builder
implements SimpleBuildStep, Serializable
Build Step wrapper for
ClassicUpload
. Can be run as a build step or in pipelines during
build and/or post-build.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Descriptor for the class.Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Nested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory
-
Field Summary
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
Constructor Summary
ConstructorsConstructorDescriptionClassicUploadStep
(String credentialsId, String bucket, UploadModule module, String pattern) Construct the classic upload step.ClassicUploadStep
(String credentialsId, String bucket, String pattern) DataBoundConstructor for the classic upload step. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
perform
(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) The main entry point of this extension.void
setPathPrefix
(String pathPrefix) void
setSharedPublicly
(boolean sharedPublicly) void
setShowInline
(boolean showInline) Methods inherited from class hudson.tasks.Builder
all, getDescriptor, prebuild
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, 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, perform, prebuild
Methods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
Constructor Details
-
ClassicUploadStep
DataBoundConstructor for the classic upload step.- Parameters:
credentialsId
- The unique ID for the credentials we are using to authenticate with GCS.bucket
- GCS bucket to upload build artifacts to.pattern
- The glob of files to upload, which potentially contains unresolved symbols, such as $JOB_NAME and $BUILD_NUMBER.- See Also:
-
ClassicUploadStep
public ClassicUploadStep(String credentialsId, String bucket, @Nullable UploadModule module, String pattern) Construct the classic upload step.- Parameters:
credentialsId
- The unique ID for the credentials we are using to authenticate with GCS.bucket
- GCS bucket to upload build artifacts to.module
- Helper class for connecting to the GCS API.pattern
- The glob of files to upload, which potentially contains unresolved symbols, such as $JOB_NAME and $BUILD_NUMBER.- See Also:
-
-
Method Details
-
setShowInline
@DataBoundSetter public void setShowInline(boolean showInline) - Parameters:
showInline
- Whether to indicate in metadata that the file should be viewable inline in web browsers, rather than requiring it to be downloaded first.
-
isShowInline
public boolean isShowInline()- Returns:
- Whether to indicate in metadata that the file should be viewable inline in web browsers, rather than requiring it to be downloaded first.
-
setPathPrefix
- Parameters:
pathPrefix
- The path prefix that will be stripped from uploaded files. May be null if no path prefix needs to be stripped.Filenames that do not start with this prefix will not be modified. Trailing slash is automatically added if it is missing.
-
getPathPrefix
- Returns:
- pathPrefix The path prefix that will be stripped from uploaded files. May be null if no
path prefix needs to be stripped.
Filenames that do not start with this prefix will not be modified. Trailing slash is automatically added if it is missing.
-
getPattern
- Returns:
- The glob of files to upload, which potentially contains unresolved symbols, such as $JOB_NAME and $BUILD_NUMBER.
-
getBucket
- Returns:
- The bucket name specified by the user, which potentially contains unresolved symbols, such as $JOB_NAME and $BUILD_NUMBER.
-
getCredentialsId
- Returns:
- The unique ID for the credentials we are using to authenticate with GCS.
-
getRequiredMonitorService
- Specified by:
getRequiredMonitorService
in interfaceBuildStep
- Overrides:
getRequiredMonitorService
in classBuilder
-
perform
public void perform(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws IOExceptionThe main entry point of this extension. Uploads files that match an Ant-style glob, e.g. ** / *.java relative to the build workspace to a GCS bucket.- Specified by:
perform
in interfaceSimpleBuildStep
- Parameters:
run
- Current job being run.workspace
- Workspace of node running the job.launcher
-Launcher
for this job.listener
- Listener for events of this job.- Throws:
IOException
- If there was an issue performing the upload.