Docker Community Forums

Share and learn in the Docker community.

Test contain before moving on in a rolling deploy


(Micahzoltu) #1

I am following a continuous delivery pattern with Docker Cloud and have my service set to a scale of 2 fronted by an haproxy container. Unfortunately, I have been having a number of problems lately where everything works fine in testing but in production I am missing some new Environment variable that needs to be passed in (e.g., new DB credentials).

Since I have 2 containers running my application, I would really like a way to validate the first one before automatically moving on to deploying the second one. I’m not sure the best way to accomplish this generally but for my specific scenario there is an HTTP endpoint that could be hit that would return a 200 if everything is good inside the container or time-out/500 if things aren’t.

Another more complex solution (but maybe more generalizable) would be to allow me to build another image/container that would define some kind of test suite that would test the container automatically after it started but before the rolling deploy moved on. If the test suite failed then the container under test would roll back.

Even more awesome would be if all of this were somehow integrated into dockercloud/haproxy so the proxy didn’t start forwarding requests to the container until after it passed its automated tests.