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

Environment variables are not available in post-build steps if the build is a matrix job

XMLWordPrintable

      If I create a regular freestyle job and use this plugin, I can set an env var and access it in a post-build step (for example, with the parameterized trigger plugin). But if I use it in a matrix job, the variable is visible in build steps, but in post-build it is not.

      Repro steps:

      1. Create a new matrix job
      2. Use 'Generate environment variables from script' and set e.g. TEST=foo
      3. Add a shell script build step and echo $TEST
      4. Add a 'Trigger parameterized build' post-build step, choose another test job which is parameterized, use 'Predefined parameters' and pass something like PARAMETER=$TEST

      In the downstream job, parameter will be set to the literal string $TEST. If the upstream job is just a regular freestyle project, when the downstream job triggers the parameter will actually be set to 'foo.'

            owenmehegan Owen Mehegan
            owenmehegan Owen Mehegan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: