4

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?

Jordon Phillips
  • 14,963
  • 4
  • 35
  • 42
andr111
  • 2,982
  • 11
  • 35
  • 45
  • 1
    You are not alone https://forums.aws.amazon.com/message.jspa?messageID=713900. Maybe take this up with Amazon and they will directly help you as they seemed to have that person. You could also parse the raw text output and look for the failure/success message instead of relying on the exit code. – dotcomly Jun 10 '16 at 04:46

1 Answers1

7

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

brice
  • 24,329
  • 7
  • 79
  • 95
  • My solution was somewhat similar, although more complex and less reliable: I wrapped 'eb deploy' in a shell script and I'm searching for "ERROR:" instead of "update completed successfully". Thanks! – andr111 Jun 16 '16 at 12:46