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

Environment variables cross references aren't supported

    XMLWordPrintable

Details

    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 abayerjglickrsandell (should it be considered as a bug ? Or an improvement to do ?)

      Attachments

        Issue Links

          Activity

            aheritier Arnaud Héritier created issue -
            aheritier Arnaud Héritier made changes -
            Field Original Value New Value
            Attachment config.xml [ 35777 ]
            abayer Andrew Bayer made changes -
            Link This issue is duplicated by JENKINS-41890 [ JENKINS-41890 ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #110 (Web Link)" [ 15420 ]
            abayer Andrew Bayer made changes -
            Link This issue is duplicated by JENKINS-41386 [ JENKINS-41386 ]
            abayer Andrew Bayer made changes -
            Link This issue is duplicated by JENKINS-41623 [ JENKINS-41623 ]
            abayer Andrew Bayer made changes -
            Link This issue is duplicated by JENKINS-42666 [ JENKINS-42666 ]
            abayer Andrew Bayer made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal OSS-1973 (Web Link)" [ 18490 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal OSS-1935 (Web Link)" [ 18506 ]
            bitwiseman Liam Newman made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

            People

              abayer Andrew Bayer
              aheritier Arnaud Héritier
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: