wrong environment configuration in the syntax reference wiki page

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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)
      

            Assignee:
            Andrew Bayer
            Reporter:
            aurelien leboulanger
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: