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

Inject the upstream's job's JOB_NAME and BUILD_NUMBER into downstream env.

    XMLWordPrintable

Details

    Description

      The target job should pre-define variables containing the job name and build number of the Job that causes the build.

      Example:

      • Upstream #3 promotes Downstream
      • Then in Downstream I have JENKINS_PROMOTING_JOB_NAME="Upstream" and JENKINS_PROMOTING_BUILD_NUMBER="3" defined

      This is useful where the downstream promotion should copy artifacts from the upstream project. The upstream's job name can be manually configured for the downstream job, but this is not possible when multiple upstream jobs should be able to trigger one downstream job.

      Currently I workaround this using the Jenkins CLI within a shell excecuting promotion where I trigger parameterized builds. But this is times slower than a "execute shell" promotion.

      Attachments

        Activity

          tholewebgods Thomas Lehmann created issue -
          tholewebgods Thomas Lehmann made changes -
          Field Original Value New Value
          Summary Inject the promoting job's JOB_NAME and BUILD_NUMBER into target env. Inject the upstream's job's JOB_NAME and BUILD_NUMBER into downstream env.
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 149593 ] JNJira + In-Review [ 177410 ]

          People

            Unassigned Unassigned
            tholewebgods Thomas Lehmann
            Votes:
            9 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: