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

wrong environment configuration in the syntax reference wiki page

    Details

    • Similar Issues:

      Description

      The environment configuration section declared in the Syntax reference in the wiki seems to contains errors.

      We can't made a reference to FOO from OTHER

      pipeline {
        agent any
        environment {
          FOO = "bar"
          OTHER = "${FOO}baz"
        }
        stages {
          stage("first stage") {
              steps {
                  echo "Hello world"
              }
          }
        }
      }
      

       
      because it's thrown this error

      groovy.lang.MissingPropertyException: No such property: FOO for class: groovy.lang.Binding
      	at groovy.lang.Binding.getVariable(Binding.java:63)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:224)
      	at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
      	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:28)
      	at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
      

        Attachments

          Issue Links

            Activity

            Hide
            abayer Andrew Bayer added a comment -

            So rather than fixing the docs, how about I fix the behavior? =) This PR, fixing JENKINS-41748, will be in the 1.1 release, which I'm planning for early next week, basically as soon as that PR gets merged. At that point, the cross-references in environment will actually work!

            Show
            abayer Andrew Bayer added a comment - So rather than fixing the docs, how about I fix the behavior? =) This PR , fixing JENKINS-41748 , will be in the 1.1 release, which I'm planning for early next week, basically as soon as that PR gets merged. At that point, the cross-references in environment will actually work!
            Hide
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            Show
            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                herau aurelien leboulanger
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: