I'm "[preparing] an environment for the run" like so, in my pipeline project:
Yet, whenever I try to follow this example in my Jenkinsfile (which looks like this):
node {
currentBuild.result = "SUCCESS"
try {
stage("Checkout") {
checkout scm
}
stage("Setup") {
def API_BASE_URL = env.API_BASE_URL
print "API_BASE_URL : ${API_BASE_URL}"
}
} catch (err) {
currentBuild.result = "FAILURE"
print "Build failed"
print err
throw err
}
}
I end up with this, in my logs:
Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Setup)
[Pipeline] echo
API_BASE_URL : null
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
Any ideas?