A server deploy script designed to quickly deploy a site with release versions while simultaneously limiting downtime due to rollbacks, failed deploys, and simultaneous deploys.
The script creates a cache on the server and updates it via
rsync. After updating the cache, the build is copied into a numerically-ordered release folder then sym-linked a consistent directory for public access. This allows for rollbacks and recovery from failed deploys.
Throughout the entire deploy process, a lockfile is present to prevent simultaneous deploys.
rsync-deploy to deploy chauncey.io; it’s worked great for me! Still, I’d like some more eyes on the code before I make this release a
v1 so if you have suggestions after trying out
rsync-deploy, please submit an issue and I’ll take it into consideration.
In particular, notice the directory structure.
Be sure to first run
rsync-deploy --init, which will setup the site on your server!
Of course! However, if you’re on OS X you may wish to use Bombich’s rsync for improvements related to resource forks.
For better security, an ssh-key is required for use of this script. If you don’t already use one, see this tutorial.
rsync-deploy.zsh to one of the following:
/usr/local/bin, or similar
- As a dependency in the root level of your project
Ensure it is executable:
Customize then add
.rsync-deploy-rc to the root level of any project you wish to deploy, one file per project. Every variable seen here is required. Set them accordingly.
This script was inspired by Capistrano, Mina, and the like.
The author(s) of this module should be contacted via the issue tracker.