我" [准备]跑步的环境"像这样,在我的管道项目中:
然而,每当我尝试在我的Jenkins文件中看到this example时(看起来像这样):
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
}
}
我最终得到了这个,在我的日志中:
Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Setup)
[Pipeline] echo
API_BASE_URL : null
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
有什么想法吗?