我正在使用您的Jenkins管道脚本之一。
我有一个默认为false的全局变量skipTests,还有一个我打算用来覆盖它的可选配置。
不幸的是,它未能说明skipTests
不存在。
错误:
groovy.lang.MissingPropertyException: No such property: skipTests for class: script999999999999999999
代码:
boolean skipTests = false;
boolean qualityGateEnabled = true;
def TRUE = "true";
void call(){
echo """|Integration Testing
|Repo Name: $REPO_NAME
|Branch Name: $BRANCH_NAME""".stripMargin();
if (config.int_test != null) {
... override values ...
}
echo "${REPO_NAME} - Integration Testing Enabled: ${skipTests}"; // << FAILS HERE
echo "${REPO_NAME} - Quality Gate Enabled: ${qualityGateEnabled}";
if (skipTests) {
echo "${REPO_NAME} - Skipping the Integration test step.";
} else {
... do work ...
}