I volunteered to help my wife convert her aging website to WordPress. In a past life I used to be a WordPress developer (*) and during that time I worked with several WordPress experts and picked up a few best practices. One practice I learned was to deploy WordPress from version control (subversion) so when WordPress gets hacked, you can easily see the changes and rollback.
So when it came time to setup my wife’s WordPress site, I turned to the deployment tool that I use on every one of my Ruby on Rails projects: Capistrano. Since I’m familiar with Capistrano’s code base from my Ruby code reading, I wanted to see if it could handle WordPress. Looking around, I found a few projects that already hooked up WordPress to Capistrano but Adam Hunter’s wp-cap was the simplest and most recent.
Basically it takes advantage of the standard
public/ directory in Rails and deploys WordPress to there. With a few extra recipes, the entire WordPress deployment is automated. The entire Capistrano configuration file with the WordPress recipes is only 71 lines of Ruby and will automatically generate a
Now I can work on her WordPress site just like in Rails:
- Hack on code
git commit -m "New code"
git push the-wordpress-server
- Sip some silver needle white tea and chill
* The first major upgrade of WordPress I did was 1.5, so I must have been using it before then.