I'm using 'eb deploy' in my continuous integration script. I'm having 2 problems with it:
It always returns returncode 0, even if there is an error. This breaks my deploy pipeline, because there is no way to detect an error.
It displays output only after command is finished.
Is there any way to make 'eb deploy' to work as any normal script and return proper error codes?
This is a know issue reported upstream here. You can fix it by using grep in a pretty straight forward way. Instead of:
eb deploy
Use grep to get the success string. This will return a non-zero status (ie: failure) if it can't be found:
eb deploy | tee /dev/tty | grep "update completed successfully"
Note how I used tee
to make sure that the output can still be seen on the continuous integration portal (in my case circleci).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With