Fixing ZDT Deploys with Monitoring-Driven Develop.
We were debugging a bug in our zero downtime deploy script. We tested the deploy using Chef, Kitchen and Vagrant. The bug was causing an error page to show for less than 3 seconds at the very end of the deploy.
We used Monitoring Driven Development to consistently reproduce the bug (the red phase), and to validate our fix (the green phase). Here were the steps:
Preparation:
kitchen login # ssh to the vagrant box
sudo tail -fn100 /var/log/nginx/go.access.log # to see the response codes from the server. If all responses show 200 code during the deploy, the deploy is working.
- Open other terminal window
kitchen login # ssh to the vagrant box
watch -n 1 "curl localhost" # make a request every 1 second
Then we followed this feedback loop
On the host computer:
- Make changes to the deploy recipe
kitchen converge # this will run our deploy
- Check the output of the logs to see the result of the changes
- Repeat the loop until bug is fixed
Written on March 18, 2017 by arturopie