etsy/deployinator

Stop deploy when there is an error

leenasn opened this issue · 1 comments

Hi,

I created a new stack and there was some problem with the path given for git checkout. Even though it showed the error, it continued with the rest of the commands. This is output:

!
Running sh -c 'cd /home/deploy/deployinator_jobs && git clone git@multunus.unfuddle.com:multunus/utwebapp.git ut'
STDERR: cd: 1: can't cd to /home/deploy/deployinator_jobs


Time: 0.000000 0.000000 0.000000 ( 0.002753)
sh -c 'cd /home/deploy/deployinator_jobs/ut && git rev-parse --short HEAD'Setting version.txt to -20110804-180358-IST
Running sh -c 'cd /home/deploy/deployinator_jobs/ut && echo -20110804-180358-IST > version.txt'
STDERR: cd: 1: can't cd to /home/deploy/deployinator_jobs/ut

Time: 0.000000 0.000000 0.010000 ( 0.002461)
Running cd /home/deploy/deployinator_jobs && cap deploy
STDERR: cd: 1: can't cd to /home/deploy/deployinator_jobs

Time: 0.000000 0.000000 0.000000 ( 0.003815)
Done!
Ended at 2011-08-04 18:04:04 +0530
Took: 5.538239679 seconds

I wanted to stop when it encounters the first error. Can you please let me know what needs to be done for the same? And also please suggest a way for me to differentiate between success and failed builds.

Note: I am running in ubuntu 10.04 with rvm ruby version 1.9.2 using shotgun. While running the STACK=new_prj rake new_stack it gave the error turn: not found which I think can be ignored.

Thanks,
Leena

Fixed this issue by using open4 instead of open3 to in run_cmd. The build should fail in case of an error now. Please accept the patch at https://github.com/alohomora/deployinator/tree/check_exit_status