I have a parameterized pipeline build with one 'String' parameter BuildOutDir
with value ${WORKSPACE}/out/
.
My pipeline script is:
node ('windows') {
stage ('Test') {
echo "$WORKSPACE"
echo "$BuildOutDir"
}
}
Output is :
[Pipeline] stage
[Pipeline] { (Test)
[Pipeline] echo
D:\jenkins\workspace\test_pipeline
[Pipeline] echo
${WORKSPACE}\out\
[Pipeline] }
[Pipeline] // stage
Is there a way to expand environment variable passed as build parameter ? This expands correctly in non-pipeline build jobs.
Eval.me("$BuildOutDir")
should work... But can't you just pass\out
and add it toWORKSPACE
? – tim_yatesWORKSPACE
as an example for an environment variable. I triedEval.me("$BuildOutDir")
, it gives me an errorhudson.remoting.ProxyException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 1: unexpected token: @ line 1, column 18.${WORKSPACE}/out/ ^ 1 error
. Not sure what i'm doing wrong. Thanks for the help. – newbie