Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS 'eb deploy' always returns returncode 0

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?

like image 248
andr111 Avatar asked Mar 13 '23 01:03

andr111


1 Answers

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).

like image 155
brice Avatar answered Mar 20 '23 08:03

brice