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 forClassicUpload
. Can be run as a build step or in pipelines during build and/or post-build.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClassicUploadStep.DescriptorImpl
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
Constructors Constructor Description ClassicUploadStep(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBucket()
String
getCredentialsId()
String
getPathPrefix()
String
getPattern()
BuildStepMonitor
getRequiredMonitorService()
boolean
isSharedPublicly()
boolean
isShowInline()
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 Detail
-
ClassicUploadStep
@DataBoundConstructor public ClassicUploadStep(String credentialsId, String bucket, String pattern)
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:
ClassicUpload(java.lang.String, com.google.jenkins.plugins.storage.UploadModule, java.lang.String, java.lang.String, java.lang.String)
-
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:
ClassicUpload(java.lang.String, com.google.jenkins.plugins.storage.UploadModule, java.lang.String, java.lang.String, java.lang.String)
-
-
Method Detail
-
setSharedPublicly
@DataBoundSetter public void setSharedPublicly(boolean sharedPublicly)
- Parameters:
sharedPublicly
- Whether to surface the file being uploaded to anyone with the link.
-
isSharedPublicly
public boolean isSharedPublicly()
- Returns:
- Whether to surface the file being uploaded to anyone with the link.
-
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
@DataBoundSetter public void setPathPrefix(@Nullable String pathPrefix)
- 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
@Nullable public String 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
public String getPattern()
- Returns:
- The glob of files to upload, which potentially contains unresolved symbols, such as $JOB_NAME and $BUILD_NUMBER.
-
getBucket
public String getBucket()
- Returns:
- The bucket name specified by the user, which potentially contains unresolved symbols, such as $JOB_NAME and $BUILD_NUMBER.
-
getCredentialsId
public String getCredentialsId()
- Returns:
- The unique ID for the credentials we are using to authenticate with GCS.
-
getRequiredMonitorService
public BuildStepMonitor getRequiredMonitorService()
- Specified by:
getRequiredMonitorService
in interfaceBuildStep
- Overrides:
getRequiredMonitorService
in classBuilder
-
perform
public void perform(Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException
The 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.
-
-