我正在使用参数根据用户输入切换阶段。
预期行为:
precheck
应运行并加载另一个管道。precheck
。当前结果:
precheck
在管道中出现了两次。precheck
舞台显示“绿色标记”而不是跳过。#main.jenkinsfile
pipeline {
parameters {
choice(name: 'PreCheck', choices: ['No','Yes'], description: 'Enable PreCheck')
}
stage('Pre-check?') {
steps {
script{
if(params.PreCheck == "Yes"){
wrap([$class: 'TimestamperBuildWrapper']){
load "pipelines/precheck.jenkinsfile"
}
}
}
}
}
}
# precheck.jenksinfile
stage('Pre-check') {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
echo "doing abc"
}
}