Class BuildPipelineTrigger
java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Publisher
hudson.tasks.Notifier
au.com.centrumsystems.hudson.plugin.buildpipeline.trigger.BuildPipelineTrigger
- All Implemented Interfaces:
ExtensionPoint,DependecyDeclarer,Describable<Publisher>,BuildStep,DependencyDeclarer
The build pipeline trigger allows the creation of downstream jobs which aren't triggered automatically. This allows us to have manual
"approval" steps in the process where jobs are manually promoted along the pipeline by a user pressing a button on the view.
- Author:
- Centrum Systems
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSet the descriptor for build pipeline trigger class This descriptor is only attached to Build Trigger Post Build action in JOB configuration pageNested classes/interfaces inherited from class hudson.tasks.Publisher
Publisher.DescriptorExtensionListImplNested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherListNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS -
Constructor Summary
ConstructorsConstructorDescriptionBuildPipelineTrigger(String downstreamProjectNames, List<hudson.plugins.parameterizedtrigger.AbstractBuildParameters> configs) Construct the trigger setting the project name and manual build promotion option -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildDependencyGraph(AbstractProject owner, DependencyGraph graph) this method is required to rebuild the dependency graph of the downstream projectList<hudson.plugins.parameterizedtrigger.AbstractBuildParameters>booleanbooleanonDownstreamProjectDeleted(String oldName) Deletes a project from downstreamProjectNames.booleanonDownstreamProjectRenamed(String oldName, String newName) Renames a project contained in downstreamProjectNamesbooleanperform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) voidremoveDownstreamTrigger(BuildPipelineTrigger bpTrigger, AbstractProject<?, ?> ownerProject, String downstreamProjectName) Removes a downstream trigger (BuildPipelineTrigger) from a project.voidsetDownstreamProjectNames(String downstreamProjectNames) Methods inherited from class hudson.tasks.Notifier
getDescriptorMethods inherited from class hudson.tasks.Publisher
all, getProjectAction, prebuildMethods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectActions, perform, prebuild
-
Constructor Details
-
BuildPipelineTrigger
@DataBoundConstructor public BuildPipelineTrigger(String downstreamProjectNames, List<hudson.plugins.parameterizedtrigger.AbstractBuildParameters> configs) Construct the trigger setting the project name and manual build promotion option- Parameters:
downstreamProjectNames- - the job name of the downstream buildconfigs- - the build parameters
-
-
Method Details
-
getDownstreamProjectNames
-
setDownstreamProjectNames
-
getConfigs
-
buildDependencyGraph
this method is required to rebuild the dependency graph of the downstream project- Specified by:
buildDependencyGraphin interfaceDependencyDeclarer- Parameters:
owner- ownergraph- graph
-
needsToRunAfterFinalized
public boolean needsToRunAfterFinalized()- Overrides:
needsToRunAfterFinalizedin classPublisher
-
getRequiredMonitorService
- Specified by:
getRequiredMonitorServicein interfaceBuildStep
-
perform
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException- Specified by:
performin interfaceBuildStep- Overrides:
performin classBuildStepCompatibilityLayer- Throws:
InterruptedExceptionIOException
-
onDownstreamProjectRenamed
Renames a project contained in downstreamProjectNames- Parameters:
oldName- - The old name of the projectnewName- - The new name of the project- Returns:
- - true: A downstream project has been renamed; false No downstream projects were renamed
-
onDownstreamProjectDeleted
Deletes a project from downstreamProjectNames.- Parameters:
oldName- - Project to be deleted- Returns:
- - true; project deleted: false; project not deleted
onDownstreamProjectRenamed(String, String)
-
removeDownstreamTrigger
public void removeDownstreamTrigger(BuildPipelineTrigger bpTrigger, AbstractProject<?, ?> ownerProject, String downstreamProjectName) Removes a downstream trigger (BuildPipelineTrigger) from a project. This removes both: - The downstream project name from the downstreamProjectNames attribute - The BuildPipelineTrigger from the AbstractProject publishers list- Parameters:
bpTrigger- - The BuildPipelineTrigger to be removedownerProject- - The AbstractProject from which to removed the BuildPipelineTriggerdownstreamProjectName- - The name of the AbstractProject associated with the BuildPipelineTrigger
-