@RequiresDomain(value=StorageScopeRequirement.class) public class ClassicUploadStep extends Builder implements SimpleBuildStep, Serializable
ClassicUpload
. Can be run as a build step or in pipelines during
build and/or post-build.Modifier and Type | Class and Description |
---|---|
static class |
ClassicUploadStep.DescriptorImpl
Descriptor for the class.
|
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory
BuildStep.PublisherList
ExtensionPoint.LegacyInstancesAreScopedToHudson
BUILDERS, PUBLISHERS
Constructor and Description |
---|
ClassicUploadStep(String credentialsId,
String bucket,
String pattern)
DataBoundConstructor for the classic upload step.
|
ClassicUploadStep(String credentialsId,
String bucket,
UploadModule module,
String pattern)
Construct the classic upload step.
|
Modifier and Type | Method and 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) |
all, getDescriptor, prebuild
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuild
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProjectAction, getProjectActions, perform, prebuild
@DataBoundConstructor public ClassicUploadStep(String credentialsId, String bucket, String pattern)
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.ClassicUpload.ClassicUpload(java.lang.String, com.google.jenkins.plugins.storage.UploadModule, java.lang.String, java.lang.String, java.lang.String)
public ClassicUploadStep(String credentialsId, String bucket, @Nullable UploadModule module, String pattern)
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.ClassicUpload.ClassicUpload(java.lang.String, com.google.jenkins.plugins.storage.UploadModule, java.lang.String, java.lang.String, java.lang.String)
@DataBoundSetter public void setSharedPublicly(boolean sharedPublicly)
sharedPublicly
- Whether to surface the file being uploaded to anyone with the link.public boolean isSharedPublicly()
@DataBoundSetter public void setShowInline(boolean showInline)
showInline
- Whether to indicate in metadata that the file should be viewable inline in
web browsers, rather than requiring it to be downloaded first.public boolean isShowInline()
@DataBoundSetter public void setPathPrefix(@Nullable String pathPrefix)
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.
@Nullable public String getPathPrefix()
Filenames that do not start with this prefix will not be modified. Trailing slash is automatically added if it is missing.
public String getPattern()
public String getBucket()
public String getCredentialsId()
public BuildStepMonitor getRequiredMonitorService()
getRequiredMonitorService
in interface BuildStep
getRequiredMonitorService
in class Builder
public void perform(Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException
perform
in interface SimpleBuildStep
run
- Current job being run.workspace
- Workspace of node running the job.launcher
- Launcher
for this job.listener
- Listener for events of this job.IOException
- If there was an issue performing the upload.Copyright © 2016–2019. All rights reserved.