1

I have finally finished setting up a fully functional environment in AWS Opsworks for one of our projects and but haven't gone fully live with it.

After doing some tweaks to one of my templates, I accidentally pushed a chef syntax error, updated my custom cookbook repo on the running instances and redeployed my app.

Midway through deployment the first instance obviously failed and the second one still carried on doing the deployment. Trying to load the site through the load balancer I can see the site already went down and the deployment on the second instance finished soon after.

Like I said this wasn't on production and once we go live we will have a staging stack as well and hopefully nothing like this should happen on live (ie. chef syntax errors), but still I was curious whether Opsworks provides something where you can say: "you've failed on one instance; now stop deploying to the rest of the instances".

It would also be nice if there was a way of getting notified when a deployment fails, like sending an SNS notification or something similar.

I was curious how other people deal with situations like these: where a deployment fails, stop deploying to all instances, notifications, rollback, etc. Or maybe I've missed some configurations on the dashboard.

1 Answer 1

0

Unfortunately OpsWorks doesn't yet support rolling deployments (like CodeDeploy and Elastic Beanstalk). Therefore it's difficult to stop the other instances which might be half way through running the task by the time one instance fails.

My suggestion is to clone your production stack to make a development stack. Have a master and a production git branch in your recipes repository, your development stack uses the master and production uses the production branch.

Do all of your work and testing on the development stack where it doesn't matter if you accidentally deploy with a Chef syntax error. Once you've tested your changes and you're satisfied that they're ready to go live then merge master into production and run the task on your production stack.

1
  • Thanks for this. That's what I had in mind as well - create a dev stack for testing and stager site.
    – Titi
    May 23, 2015 at 11:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .