Git deployment with Dandelion
Git is the bee’s knees when it comes to version control and definitely my DCVS of choice. It’s an indispensable tool for collaborating with other developers and has become such an integral part of my development workflow that I cannot imagine working nearly as effectively without it.
When it comes time for deployment, there are a handful of fantastic options including Capistrano or even just Git itself, however, these require shell access to the server- something that is usually not available in shared hosting environments. One is left either transferring the entire codebase to the server on every deployment (very time consuming) or manually keeping track of which files have changed since the last time we deployed (error prone).
Dandelion takes the second approach but manages revisions for you so there’s no need to manually track changed files- Git does this anyway and Dandelion leverages that. Dandelion keeps track of the currently deployed revision so that it may later be used to generate a list of files that have been changed, added or deleted and transfer those files via FTP or SFTP.
Dandelion is written in Ruby and requires that both Ruby and RubyGems be installed (note that Ruby 1.9 now includes RubyGems by default). Rather than using your operating system’s packaging system, I highly recommend using RVM for installing and managing Ruby versions and gems.
Assuming Ruby is ready to go, install Dandelion…
$ gem install dandelion
In the root of the Git repository you wish to deploy, create a file called dandelion.yml in which to specify configuration options.
Then start deploying.
$ dandelion deploy
This will transfer all files in the HEAD revision of your repository to the location specified in dandelion.yml. Next time you deploy, Dandelion will know which files have changed saving you time and headache.
For more information or to contribute to Dandelion head over to http://github.com/scttnlsn/dandelion.