I use DeployHQ to automatically deploy WordPress projects on Github to whatever server they need up on. DeployHQ is pretty good, but the deploys aren’t atomic. This means that, if a given deploy takes a minute and a half to perform its filesystem operations, your web server could be serving inconsistent application state for up to a minute and a half, potentially causing fatals and who knows what.
To perform a more atomic deploy, use DeployHQ to deploy your project to a deploy directory, and then run a post-deploy copy command to move your files where they need to be.
As you can see, I’m trialling ServerPilot for managing servers. More on that later, possibly.
2 Comments
Hey Daniel, this is a great work around for atomic deploys. One issue with using cp though, it doesn’t delete files. I solved this for one of our projects by using rsync, somthing like this;
rsync -avz –delete “/srv/www/…/deploy/” “/srv/www/…/current/”
Might be helpful to someone.
Just a quick heads up. DeployHQ now has “proper” support for atomic deployments.