Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44721

Trigger pipelines that depend on generated snapshot artifacts

      withMaven() should be able to trigger pipelines that depend on the snapshots generated by the current pipeline

          [JENKINS-44721] Trigger pipelines that depend on generated snapshot artifacts

          Here's a screenshot of the option I'm referring to

          Nathan Vahrenberg added a comment - Here's a screenshot of the option I'm referring to

          nv035674 good idea, can you please create a dedicated Jira issue?

          Cyrille Le Clerc added a comment - nv035674 good idea, can you please create a dedicated Jira issue?

          Logged JENKINS-46152

           

          cleclerc in regards to your question I did notice that the Last Successful Artifacts has changed slightly. It used to archive the artifact that includes the timestamp (myapp-1.11.0-201780809.160055-9.jar) and now archives just the artifactId and version (myapp-1.11.0.jar). I don't think it really affects anything though.

          The fingerprints are likewise changed: 

          • Old: com/group/blah/blah/myapp/1.4.1-20170811.043839-30/myapp-1.4.1-20170811.043839-30-sources.jar
          • New: com/group/blah/blah/myotherapp/1.1.4-SNAPSHOT/myotherapp-1.1.4-SNAPSHOT-sources.jar

          I don't really know a whole lot about how exactly the fingerprinting works and what it is used for, so I can't say if this will affect anything.

          Nathan Vahrenberg added a comment - Logged  JENKINS-46152   cleclerc in regards to your question I did notice that the Last Successful Artifacts has changed slightly. It used to archive the artifact that includes the timestamp (myapp-1.11.0-201780809.160055-9.jar) and now archives just the artifactId and version (myapp-1.11.0.jar). I don't think it really affects anything though. The fingerprints are likewise changed:  Old: com/group/blah/blah/myapp/1.4.1-20170811.043839-30/myapp-1.4.1-20170811.043839-30-sources.jar New: com/group/blah/blah/myotherapp/1.1.4-SNAPSHOT/myotherapp-1.1.4-SNAPSHOT-sources.jar I don't really know a whole lot about how exactly the fingerprinting works and what it is used for, so I can't say if this will affect anything.

          nv035674 this change is expected. Thanks to this change, the version in the fingerprinted file name will be consistent whatever you call "mvn deploy" or "mvn package"

          Cyrille Le Clerc added a comment - nv035674 this change is expected. Thanks to this change, the version in the fingerprinted file name will be consistent whatever you call "mvn deploy" or "mvn package"

          cleclerc Ok, that's what I figured, just wanted to point it out just in case the timestamp was important for the fingerprints. Let me know if there's anything else I can help with.

          Nathan Vahrenberg added a comment - cleclerc  Ok, that's what I figured, just wanted to point it out just in case the timestamp was important for the fingerprints. Let me know if there's anything else I can help with.

          Cyrille Le Clerc added a comment - - edited

          > Let me know if there's anything else I can help with.

          nv035674 if you can test the feature on jenkins servers, if possible with real workloads, this would be perfect.

          Cyrille Le Clerc added a comment - - edited > Let me know if there's anything else I can help with. nv035674 if you can test the feature on jenkins servers, if possible with real workloads, this would be perfect.

          cleclerc I've got this up and running on our development jenkins server, and as far as I can tell everything looks good. I added the snapshotDependencies() property to the shared library and jobs seem to be figuring out their upstream dependencies just fine. I'm also glad to see that some of the little features still work, such as the "cause" of the build populates correctly:

           

          Started by upstream project "myApp" build number 36
          originally caused by:
           * Started by user Vahrenberg,Nathan

           

          In fact if we can get the functionality described in JENKINS-46152 I think we'll be in really good shape.

          Nathan Vahrenberg added a comment - cleclerc I've got this up and running on our development jenkins server, and as far as I can tell everything looks good. I added the snapshotDependencies() property to the shared library and jobs seem to be figuring out their upstream dependencies just fine. I'm also glad to see that some of the little features still work, such as the "cause" of the build populates correctly:   Started by upstream project "myApp" build number 36 originally caused by: * Started by user Vahrenberg,Nathan   In fact if we can get the functionality described in  JENKINS-46152  I think we'll be in really good shape.

          Cyrille Le Clerc added a comment - - edited

          nv035674 can you please test 3.0.0-beta-4 and the skip feature as documented on the Plugin wiki page?

          https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.0.0-beta-4

          The pipeline of the maven project for which you don't want to trigger downstream jobs is likely to look like:

          properties([pipelineTriggers([snapshotDependencies()])])
          ...
          withMaven(options: [pipelineGraphPublisher(skipDownstreamTriggers: true)]) {
             // trigger this pipeline when dependencies are generated by upstream pipelines but don't trigger downstream pipelines according to the generated artifact of this maven project
             sh "mvn package"
          }
          

          Cyrille Le Clerc added a comment - - edited nv035674 can you please test 3.0.0-beta-4 and the skip feature as documented on the Plugin wiki page? https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.0.0-beta-4 The pipeline of the maven project for which you don't want to trigger downstream jobs is likely to look like: properties([pipelineTriggers([snapshotDependencies()])]) ... withMaven(options: [pipelineGraphPublisher(skipDownstreamTriggers: true )]) { // trigger this pipeline when dependencies are generated by upstream pipelines but don't trigger downstream pipelines according to the generated artifact of this maven project sh "mvn package " }

          cleclerc just finished testing out beta-4, everything looks good. Enabling the skipDownstreamTriggers flag successfully blocks any downstream projects from automatically building, while still allowing upstream projects to build the job. 

          Nathan Vahrenberg added a comment - cleclerc just finished testing out beta-4, everything looks good. Enabling the skipDownstreamTriggers flag successfully blocks any downstream projects from automatically building, while still allowing upstream projects to build the job. 

          Fixed in 3.0.0

          Cyrille Le Clerc added a comment - Fixed in 3.0.0

            cleclerc Cyrille Le Clerc
            cleclerc Cyrille Le Clerc
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: