public class JobcopyBuilder
extends hudson.tasks.Builder
| Modifier and Type | Class and Description |
|---|---|
static class |
JobcopyBuilder.DescriptorImpl
The internal class to work with views.
|
| 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,
hudson.model.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(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener) |
all, getDescriptor, getRequiredMonitorService, 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(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
throws IOException,
InterruptedException
perform in interface hudson.tasks.BuildStepperform in class hudson.tasks.BuildStepCompatibilityLayerIOExceptionInterruptedExceptionpublic static <T> T getRelative(String pathName, hudson.model.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–2020. All rights reserved.