Hi,
Since I upgrade my pipeline definition plugin to 1.1.1 my JenkinsFile are not valid anymore. The refactoring done on the parseEnvironment method seems to be the root cause.
What I'm doing is declaring a set of constants at the begining of my Jenkins files and using them at several places in the pipeline. It works everywhere but in the environment block.
In the environment block if I use the constant name directly it throws an error because I must use a (inlined) constant or a function call. If I put my variable between double quote it says it can't bind it.
Here is a sample pipepline :
def BAR = "bar";
pipeline {
environment {
FOO = "${BAR}" // Binding Error FOO = BAR // Environment variable values must either be strings or function calls
}
agent {
label "some-label"
}
stages {
stage("foo") {
steps {
sh 'echo "FOO is $FOO"'
}
}
}
}
Is it a normal it doesn't work anymore or a bug ?
Regards.