I'm currently facing the problem that I want to set a stage, in this case stage 2, to "UNSTABLE" if some steps fail and to "FAILED" if more then e.g. 60% of the steps are failing.
My Jenkins file currently looks like this:
pipeline {
agent any
stages {
stage("stage1") {
steps {
echo "prepare some stuff"
}
}
stage("stage2") {
steps {
parallel(
"step1": {
sh 'false'
},
"step2": {
sh 'true'
},
"step3": {
sh 'false'
}
)
}
}
stage('stage3') {
steps {
echo "do some other stuff"
}
}
}
}