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

In a Matrix job, Environment Script variables are not expanded in a Parameterized Build Trigger

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Jenkins 1.477
      Parametrized Trigger ...
      Environment Script ...

      Install Jenkins with both environment-script and parameterized-trigger plugins.

      This WORKS:

      Create a freestyle project.
      Check "Generate environment variables from script"
      Enter "echo Hello=World" into the script box.

      Add a post-build action "Trigger parameterized build on other projects"
      Select "Predefined parameters"
      Enter "Hello=$Hello" into the params box.

      Run the build. Note that the param to the next build is Hello=World.

      This DOES NOT WORK:

      Create a matrix project.
      Check "Generate environment variables from script"
      Enter "echo Hello=World" into the script box.
      Check the "Run only on parent" box.

      Add a post-build action "Trigger parameterized build on other projects"
      Select "Predefined parameters"
      Enter "Hello=$Hello" into the params box.

      Run the build. Note that the param to the next build is Hello=$Hello.

      Identical behavior if Run Only On Parent is checked or not, but I expect that this is a required option, because the post-build steps occur on the parent as well.

            jorgenpt Jørgen Tjernø
            sodabrew Aaron Stone
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: