Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
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
- is duplicated by
-
JENKINS-42666 wrong environment configuration in the syntax reference wiki page
-
- Closed
-
-
JENKINS-41386 need to support or reject non string based environment variables.
-
- Closed
-
-
JENKINS-41623 Variable Expansion in Global Variables Not Occurring
-
- Closed
-
-
JENKINS-41890 Declarative syntax: ${env.WORKSPACE} not set in environment block
-
- Closed
-
- links to
Environment :
docker-workflow:1.9.1:not-pinned pipeline-aggregator-view:1.4.1:not-pinned pipeline-build-step:2.4:not-pinned pipeline-github-lib:1.0:not-pinned pipeline-graph-analysis:1.3:not-pinned pipeline-input-step:2.5:not-pinned pipeline-milestone-step:1.3:not-pinned pipeline-model-api:1.0:not-pinned pipeline-model-declarative-agent:1.0:not-pinned pipeline-model-definition:1.0:not-pinned pipeline-rest-api:2.4:not-pinned pipeline-stage-step:2.2:not-pinned pipeline-stage-tags-metadata:1.0:not-pinned pipeline-stage-view:2.4:not-pinned pipeline-utility-steps:1.2.2:not-pinned workflow-aggregator:2.5:not-pinned workflow-api:2.8:not-pinned workflow-basic-steps:2.3:not-pinned workflow-cps:2.25:not-pinned workflow-cps-global-lib:2.5:not-pinned workflow-durable-task-step:2.8:not-pinned workflow-job:2.9:not-pinned workflow-multibranch:2.12:not-pinned workflow-scm-step:2.3:not-pinned workflow-step-api:2.8:not-pinned workflow-support:2.12:not-pinned
On Jenkins ver. 2.32.1