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

Environment variables are NOT passed further build steps when using "Block until the triggered projects finish their builds"

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      In section Usage as a Build step in https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin its mentioned that, When using the Trigger/Call builds on another project item. If the trigger is configured with the Block until the triggered projects finish their builds enabled, the following Environment variables are made available for further build steps

      • LAST_TRIGGERED_JOB_NAME="Last project started"
      • TRIGGERED_BUILD_NUMBER_<project name>="Last build number triggered"

      version 2.17 onwards

      • TRIGGERED_JOB_NAMES="Comma separated list of all triggered projects"
      • TRIGGERED_BUILD_NUMBERS_<project name>="Comma separated list of build numbers triggered"
      • TRIGGERED_BUILD_RESULT_<project name>="Last triggered build result of project"
      • TRIGGERED_BUILD_RESULT_<project name>RUN<build number>="Result of triggered build for build number"
      • TRIGGERED_BUILD_RUN_COUNT_project name>="Number of builds triggered for the project"

      I tried configuring one upstream and downstream job. But I don’t see these ENV variables being passed to downstream jobs?

      PS: I am checking for these ENV variables in Build step of downstream job like 'env|grep TRIGGERED'

        Attachments

          Activity

          Hide
          ikedam ikedam added a comment -

          They are available in further build steps, not in downstream builds.
          For example, think the following case project1 triggers project2.

          • project1:
            • Build Steps:
              • Trigger/Call builds on another project (Block until the triggered projects finish their builds): project2
              • [A] Run Shell script
          • project2:
            • Build Steps:
              • [B] Run Shell script

          In this case, TRIGGERED_XXXX will be available in A, not in B.

          Show
          ikedam ikedam added a comment - They are available in further build steps, not in downstream builds. For example, think the following case project1 triggers project2. project1: Build Steps: Trigger/Call builds on another project (Block until the triggered projects finish their builds): project2 [A] Run Shell script project2: Build Steps: [B] Run Shell script In this case, TRIGGERED_XXXX will be available in A, not in B.

            People

            Assignee:
            huybrechts huybrechts
            Reporter:
            dilipm79 Dilip Mahadevappa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: