ci(aio): correctly catch PR preview pre-verification errors
Previously, `aio/aio-builds-setup/scripts/travis-preverify-pr.sh` was supposed to exit with 1 if a PR did not meet the preconditions and 2 if an error occurred during pre-verification. It relied on the exit codes of the node script that did the actual work, but didn't account for errors that would be thrown in the `sh` script itself (e.g. if the node script was not available). This caused such errors to appear as non-verified PRs, instead of real errors that should fail the build. This commit swaps the exit codes, so that now a 2 means non-verified PR and 1 designates an error.
This commit is contained in:

committed by
Igor Minar

parent
569b1e0eb7
commit
bcefc61da4
@ -27,17 +27,17 @@ case $preverifyExitCode in
|
||||
# Preconditions met: Deploy
|
||||
;;
|
||||
1)
|
||||
# An error occurred: Fail the script
|
||||
exit 1
|
||||
;;
|
||||
2)
|
||||
# Preconditions not met: Skip deploy
|
||||
echo "Skipping deploy because this PR did not meet the preconditions."
|
||||
exit 0
|
||||
;;
|
||||
2)
|
||||
# An error occurred: Fail the script
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
# Unexpected exit code: Fail the script
|
||||
echo "Unexpected preverification exit code: $preverifyExitCode"
|
||||
echo "Unexpected pre-verification exit code: $preverifyExitCode"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
Reference in New Issue
Block a user