下面的代码在从故障块调用特定阶段时给我一个错误。感谢有人在这里提供帮助。谢谢!
def remainingStages = true
pipeline {
agent any
stages {
stage('Headless Run') {
steps{
echo 'Running stage1..'
withCredentials([string(credentialsId: 'SauceLabHeadlessAcc', variable: 'BUILD_AUTH')])
}
post {
success {
echo 'Stage 1 completed successfully'
script {
remainingStages = false
echo "Going to next Stage:"+ remainingStages
}
}
failure {
echo 'Headless FAILED.. Jumping to Regular '
Stage: 'REGULAR run'
}
}
}
stage('REGULAR run') {
when {
expression {
remainingStages
}
}
steps{
echo 'Running stage2..'
}
}
}
}