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

Environment variables cross references aren't supported

    Details

    • Similar Issues:

      Description

      Unlike documented here https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/Syntax-Reference such sample doesn't work

          environment {
              FOO = "bar"
              OTHER = "${FOO}baz"
          }
      

      Firstly ${FOO} cannot work it is a groovy variable and it should be escaped

      OTHER = "\${FOO}baz"
      

      or

      OTHER = '${FOO}baz'
      

      And even by escaping it it's not working

      and we have

      [declarative-pipeline] Running shell script
      + printenv
      ...
      OTHER=nullbaz
      ...
      FOO=bar
      ...
      

      note that FOO is seen as null which makes no sense in shell env (it should be empty if unknown.

      cc Andrew BayerJesse Glickrsandell (should it be considered as a bug ? Or an improvement to do ?)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                aheritier Arnaud Héritier
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: