[JIRA] (JENKINS-43013) environment directive doesn't properly order GString evaluation

1 view
Skip to first unread message

bitwiseman@gmail.com (JIRA)

unread,
Mar 21, 2017, 8:50:02 PM3/21/17
to jenkinsc...@googlegroups.com
Liam Newman created an issue
 
Jenkins / Improvement JENKINS-43013
environment directive doesn't properly order GString evaluation
Issue Type: Improvement Improvement
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2017/Mar/22 12:49 AM
Environment: 1.1.1
Priority: Major Major
Reporter: Liam Newman
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

bitwiseman@gmail.com (JIRA)

unread,
Mar 21, 2017, 8:54:01 PM3/21/17
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
Change By: Liam Newman
On Declarative 1.1.1, with this Pipeline, I get an error:
repo: https://github.com/bitwiseman/hermann/
branch:  issue/blue-ocean-editor/env-order

{code}
pipeline {
  agent any
  environment {
    test2 = "value2"
    test3 = "${test2}"
    test = "${test2 + test3}"
  }
  stages {
    stage('Install') {
      steps {
        sh 'echo "${test}"'
      }
    }
  }
}
{code}

"groovy.lang.MissingPropertyException: No such property: test2 for class: groovy.lang.Binding"

This also errors the same way:
{code}
pipeline {
  agent any
  environment {
    test = "${test2 + test3}"
    test2 = "value2"
    test3 = "${test2}"
  }
  stages {
    stage('Install') {
      steps {
        sh 'echo "${test}"'
      }
    }
  }
}
{code}


I'd expect the second example to error, due to out-of-order assignment.  If this too can be fixed, that'd be fine, too.  But the simple sequential evaluation of show in the first example should always work.

andrew.bayer@gmail.com (JIRA)

unread,
Mar 30, 2017, 12:09:01 PM3/30/17
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Mar 30, 2017, 12:09:02 PM3/30/17
to jenkinsc...@googlegroups.com
Andrew Bayer started work on Improvement JENKINS-43013
 
Change By: Andrew Bayer
Status: Open In Progress

andrew.bayer@gmail.com (JIRA)

unread,
Mar 30, 2017, 12:09:02 PM3/30/17
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:14 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
 

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