public class JobcopyBuilder extends Builder
| Modifier and Type | Class and Description |
|---|---|
static class |
JobcopyBuilder.DescriptorImpl
The internal class to work with views.
|
ExtensionPoint.LegacyInstancesAreScopedToHudsonBuildStep.PublisherListBUILDERS, PUBLISHERS| Constructor and Description |
|---|
JobcopyBuilder(String fromJobName,
String toJobName,
boolean overwrite,
List<JobcopyOperation> jobcopyOperationList,
List<AdditionalFileset> additionalFilesetList)
Constructor to instantiate from parameters in the job configuration page.
|
| Modifier and Type | Method and Description |
|---|---|
List<AdditionalFileset> |
getAdditionalFilesetList()
Retuns a list of sets of files to copy additional to JOBNAME/config.xml.
|
String |
getFromJobName()
Returns the name of job to be copied from.
|
List<JobcopyOperation> |
getJobcopyOperationList()
Returns the list of operations.
|
static <T> T |
getRelative(String pathName,
ItemGroup<?> context,
Class<T> klass)
Reimplementation of
Jenkins.getItem(String, ItemGroup, Class)
Existing implementation has following problems:
* Falls back to Jenkins.getItemByFullName(String)
* Cannot get ItemGroup |
String |
getToJobName()
Returns the name of job to be copied to.
|
boolean |
isOverwrite()
Returns whether to overwrite an existing job.
|
boolean |
perform(AbstractBuild<?,?> build,
Launcher launcher,
BuildListener listener) |
all, getDescriptor, getRequiredMonitorService, prebuildgetProjectAction, getProjectAction, getProjectActions, perform, prebuild@DataBoundConstructor public JobcopyBuilder(String fromJobName, String toJobName, boolean overwrite, List<JobcopyOperation> jobcopyOperationList, List<AdditionalFileset> additionalFilesetList)
fromJobName - a name of a job to be copied from. may contains variable expressions.toJobName - a name of a job to be copied to. may contains variable expressions.overwrite - whether to overwrite if the job to be copied to is already existing.jobcopyOperationList - the list of operations to be performed when copying.additionalFilesetList - the list of sets of files to copy additional to JOBNAME/config.xml.public String getFromJobName()
public String getToJobName()
public boolean isOverwrite()
| isOverwrite | behavior |
|---|---|
| true | Overwrite the configuration of the existing job. |
| false | Build fails. |
public List<JobcopyOperation> getJobcopyOperationList()
public List<AdditionalFileset> getAdditionalFilesetList()
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException
perform in interface BuildStepperform in class BuildStepCompatibilityLayerIOExceptionInterruptedExceptionpublic static <T> T getRelative(String pathName, ItemGroup<?> context, Class<T> klass)
Jenkins.getItem(String, ItemGroup, Class)
Existing implementation has following problems:
* Falls back to Jenkins.getItemByFullName(String)
* Cannot get ItemGroupT - class of the item to retrievepathName - relative path to an item to retrievecontext - context to calculate pathName from.klass - class of the item to retrieveCopyright © 2016–2023. All rights reserved.