Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JENKINS-46511] Only trigger downstream pipelines if maven builds rea…
…ch a threshold lifecycle phase. The default minimum lifecycle phase is "deploy", can be configured to trigger downstream pipeline on "install" or on "package"
- Loading branch information
Showing
with
819 additions
and 1,141 deletions.
- +39 −23 ...-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java
- +24 −0 jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtils.java
- +5 −1 ...ain/resources/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher/config.jelly
- +24 −0 ...g/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher/help-lifecycleThreshold.html
- +23 −0 jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/DependencyGraphTest.java
- +13 −0 jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtilsTest.java
- +57 −53 jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/maven-spy-deploy-jar.xml
- +230 −1,064 ...plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/maven-spy-nexus-deploy-release.xml
- +400 −0 jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/maven-spy-package-jar.xml
- +4 −0 ...src/main/java/org/jenkinsci/plugins/pipeline/maven/eventspy/handler/AbstractExecutionHandler.java
@@ -0,0 +1,24 @@ | ||
<div> | ||
<p> | ||
Threshold to trigger downstream pipelines based on the <a href="https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html">Maven lifecycle</a> | ||
phase successfully reached during the Maven execution. | ||
</p> | ||
<p> | ||
If "install" is selected then downstream pipelines will be triggered for "<code>mvn clean install</code>", "<code>mvn clean deploy</code>" | ||
but NOT "<code>mvn clean verify</code>" or "<code>mvn clean package</code>". | ||
</p> | ||
|
||
<h2>Example</h2> | ||
<p>Configure a Jenkins Multibranch Pipeline with | ||
<ul> | ||
<li>Threshold: "<code>deploy</code>"</li> | ||
<li>execution of "<code>mvn clean deploy</code>" on branches (incl. master) and execution of "<code>mvn clean | ||
verify</code> on pull requests</li> | ||
</ul> | ||
So that: | ||
<ul> | ||
<li>The builds of branches (incl. "master") would upload the generated jar/war file to your enterprise Maven repository and would trigger downstream pipelines</li> | ||
<li>The builds of pull request would only build the package but NOT upload the generated jar/war file to your enterprise Maven repository and would NOT trigger downstream pipelines</li> | ||
</ul> | ||
</p> | ||
</div> |
Oops, something went wrong.