In a Declarative Pipeilne which defines an environment variable which is derivative of a built-in, e.g.
This results in this error:
hudson.remoting.ProxyException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/var/jenkins_home/jobs/cloudbees-training/jobs/training-commons/branches/PR-143/builds/1/libs/training-commons/vars/commonTrainingPipeline.groovy: 16: Environment variable values must either be strings or function calls. @ line 16, column 24.
/var/jenkins_home/jobs/cloudbees-training/jobs/training-commons/branches/PR-143/builds/1/libs/training-commons/vars/commonTrainingPipeline.groovy: 13: No variables specified for environment @ line 13, column 5.
The easy solution here is to quote the variable, e.g.:
I understand why this is so, but I think the error message and the resulting solution are confusing and not intuitive to most Declarative Pipeline users.
A better, more task-oriented error message would be helfpful IMHO