[JIRA] (JENKINS-42666) wrong environment configuration in the syntax reference wiki page

2 views
Skip to first unread message

n27@3ds.com (JIRA)

unread,
Mar 10, 2017, 8:26:03 AM3/10/17
to jenkinsc...@googlegroups.com
aurelien leboulanger created an issue
 
Jenkins / Bug JENKINS-42666
wrong environment configuration in the syntax reference wiki page
Issue Type: Bug Bug
Assignee: Andrew Bayer
Attachments: Screen Shot 2017-03-10 at 2.21.48 PM.png
Components: pipeline-model-definition-plugin
Created: 2017/Mar/10 1:25 PM
Environment: Jenkins 2.49 / pipeline model definition plugin 1.0.2
Labels: documentation
Priority: Major Major
Reporter: aurelien leboulanger

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)
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

andrew.bayer@gmail.com (JIRA)

unread,
Mar 10, 2017, 1:02:03 PM3/10/17
to jenkinsc...@googlegroups.com
Andrew Bayer resolved as Duplicate
 

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!

Change By: Andrew Bayer
Status: Open Resolved
Resolution: Duplicate

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:24:12 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Duplicate
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages