I have a AWS CodeBuild template in a buildspec.yml file with the following line in the build section:
- if [ "${STAGE}" = "alpha" ]; then echo "Quitting alpha build." && exit 0; fi
My expectation is that the build should exit the build if the $STAGE variable is set to alpha
with a successful finish. However, it goes to the next line.
If I change the exit code to 1
, the build fails at that point as expected.
Any ideas how to end a build prematurely like this, and is there something obviously wrong with this line?