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

Feature to copy artifact from different upstream projects

    XMLWordPrintable

Details

    Description

      Could you fix a way to copy an artifact from a build of an upstream project that triggered the build (that is, not only from an upstream build of a given project)?
      For example, if I have project A1 and A2 that both trigger job B, I want to copy an artifact from A1 OR A2, depending on which project triggered the specefic build of B.

      Attachments

        Activity

          dreamtime Angela Johansson created issue -
          mindless Alan Harder added a comment -

          I would add a copyartifact build step for each possible upstream project, marking each of these as optional.. does this workaround work?

          mindless Alan Harder added a comment - I would add a copyartifact build step for each possible upstream project, marking each of these as optional.. does this workaround work?
          mindless Alan Harder made changes -
          Field Original Value New Value
          Assignee Alan Harder [ mindless ]
          Summary Feature to copy artifact from upstream project Feature to copy artifact from different upstream projects

          Yes, thanks, that works for us. The only problem that remains is that the promotion of builds A1 and A2 are not triggered although we copy the correct fingerprinted artifacts now.

          dreamtime Angela Johansson added a comment - Yes, thanks, that works for us. The only problem that remains is that the promotion of builds A1 and A2 are not triggered although we copy the correct fingerprinted artifacts now.

          We are running into a tricky interaction between the workaround provided by Alex and JENKINS-12134. We are copying artifacts from both projects, and when it is used with Upstream build that triggered this job, it works fine - one projects artifacts are copied and fingerprinted. But if you want to do something like Last successful build, then it copies artifacts from both projects. You can go ahead and work around that by passing a parameter to select which one you really mean, but because the plugin is automatically fingerprinting all artifacts, then you end up with a link to both upstream builds when you really only operated on one upstream builds artifacts.

          krw1243 Kelsey Prantis added a comment - We are running into a tricky interaction between the workaround provided by Alex and JENKINS-12134 . We are copying artifacts from both projects, and when it is used with Upstream build that triggered this job, it works fine - one projects artifacts are copied and fingerprinted. But if you want to do something like Last successful build, then it copies artifacts from both projects. You can go ahead and work around that by passing a parameter to select which one you really mean, but because the plugin is automatically fingerprinting all artifacts, then you end up with a link to both upstream builds when you really only operated on one upstream builds artifacts.

          @Alan - the workaround doesn't quite for us. Here's our scenario:

          Jobs:

          BuildTrunk - builds the project files from trunk
          BuildBranch1_00 - builds project files from branch 1.00
          BuildBranch2_00 - builds project files from branch 2.00
          PackageTrunk - packages the results of BuildTrunk
          PackageBranch1_00 - packages the results of BuildBranch1_00
          PackageBranch2_00 - packages the results of BuildBranch2_00
          Test - Test is downstream from PackageXYZ

          'Test' can run from any of the package jobs, but we create new build and package jobs for each branch. It would be helpful to us to avoid having to duplicate yet another project for each job to maintain our test configurations. What would make this easy is if I could select "Upstream project that triggered this job" in addition to "Upstream build". I see that the information is available on the build page ("Started by ..." on the individual build page). Is it possible to use that same information to implement this feature?

          ahawtho Adam Hawthorne added a comment - @Alan - the workaround doesn't quite for us. Here's our scenario: Jobs: BuildTrunk - builds the project files from trunk BuildBranch1_00 - builds project files from branch 1.00 BuildBranch2_00 - builds project files from branch 2.00 PackageTrunk - packages the results of BuildTrunk PackageBranch1_00 - packages the results of BuildBranch1_00 PackageBranch2_00 - packages the results of BuildBranch2_00 Test - Test is downstream from PackageXYZ 'Test' can run from any of the package jobs, but we create new build and package jobs for each branch. It would be helpful to us to avoid having to duplicate yet another project for each job to maintain our test configurations. What would make this easy is if I could select "Upstream project that triggered this job" in addition to "Upstream build". I see that the information is available on the build page ("Started by ..." on the individual build page). Is it possible to use that same information to implement this feature?
          shapiy Serhiy Hapiy added a comment -

          Our workaround is to invoke the downstream build using the Parametrized Trigger plugin. We pass the upstream project name as a parameter.

          But we cannot use "Build after other projects..." approach in this case, which results in increased complexity of configurations.

          shapiy Serhiy Hapiy added a comment - Our workaround is to invoke the downstream build using the Parametrized Trigger plugin . We pass the upstream project name as a parameter. But we cannot use "Build after other projects..." approach in this case, which results in increased complexity of configurations.
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 139883 ] JNJira + In-Review [ 175170 ]

          People

            Unassigned Unassigned
            dreamtime Angela Johansson
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated: