I am running some tests. If the test are successful I want the workflow to continue. If the tests are a failure, I want to leave it “on hold” for an admin to see it (visual regression tests may fail, but an admin may decide “this was the expected visual result”).
Is there a way to make the workflow/jobs go on hold only if something fails?
Hi @stella
Thanks for the answer, but this gives conditioning on the steps level, inside a job.
I want to trigger (or not trigger) a whole job based on the results of an other job.
I want
If job A fails -> trigger approval job B -> when approved trigger job C
Here is an example approach.
You can restructure your configuration to have 3 workflows.
The workflow containing job A would become a conditional workflow that runs by default unless a certain pipeline parameter is given.
" approval job B -> when approved trigger job C" could be modelled as a second workflow that is conditional on a pipeline parameter, and there can be a third workflow that runs job C and that is also conditional on a pipeline parameter.
if [ $testresult = 0 ] && [[ $git_message == *"[AUTO-PROCEED]"* ]]; then
echo "The auto-proceed message exists and the testresult is 0"
#Parameter 3 is release_init
#Parameter 4 is release_hold
#Parameter 5 is release_finish
./trigger_api.sh $CIRCLE_PROJECT_REPONAME $CIRCLE_BRANCH false false true
else
echo "Either the auto-proceed does not exist or the testresult is not 0"
#Parameter 3 is release_init
#Parameter 4 is release_hold
#Parameter 5 is release_finish
./trigger_api.sh $CIRCLE_PROJECT_REPONAME $CIRCLE_BRANCH false true false
fi;
c) We have setup the following in the repos config files: