Managing Wordpress and other PHP projects with Ruby

by Vid Luther on January 12, 2010

in blog, git, php, symfony, version control, web

The past month or so has given us a lot of blog posts on how, and why we should use automated build and deploy systems.
One of the best deployment systems out there (imho), is by the Ruby community, and it’s called Capistrano. We’ve been using it internally since this summer to manage and deploy our Symfony application with great success. I’ll be sharing the methodology to “Capify” a Symfony project soon, but first I wanted to share the Wordpress-Capistrano project.

The goals of the project are:

  1. Make deployment and upgrades of Wordpress easier for multiple installs of wordpress on multiple hosts
  2. Secure Wordpress in production by setting stricter permissions, to prevent SQL/XSS attacks that modify PHP files.
  3. Allow one to easily manage the 3 tiered development cycle, but with Wordpress
  4. Make deployment of Wordpress simpler on the Rackspace Cloud
  5. Synchronization of Wordpress stages (move db from production to stage, push configuration settings to production)

Currently, you can clone the repository, configure wordpress locally, setup your Capistrano recipe and start deploying.

I’ve tried to comment out the recipes, but I’m sure I need to do a better job. Feel free to ask me any questions, post issues and patches.

I’m also looking into the Moonshine project, and perhaps forking it to be independent of Rails, I’m really digging it’s ease of use and depth of features.

  • Jack
    Could you share your deploy.rb for deploying to RackSpace Cloud Sites?
  • I wrote a tutorial some time ago detailing how to deploy a PHP application with Capistrano.

    http://mathew-davies.co.uk/index.php/2009/10/de...

    I don't think there's a need for a wordpress plugin though. I learnt how to customize the recipe within a couple of days.

    Looking forward to see what you're coming up with, should be interesting.
  • a_musing_moose
    I find it interesting that you decided to use a ruby build tool for PHP projects. What made you decide to use Capistrano rather than say Phing?
  • vidluther
    The amount of documentation for Capistrano and the fact that I wanted to learn Ruby, without learning RoR.

    The second reason is the sheer amount of awesomeness moonshine. I've seen my friends who are RoR guys, managing/deploying their entire server with it. It's very mature and useful.
  • a_musing_moose
    Fair enough and thanks for the reply.

    We use Phing ourselves for some pretty major deployments. Although there is some pressure from others to switch to other build tools (e.g. Ant, Capistrano etc) but I have always resisted moving outside the core development language unless there is good reason.
  • vidluther
    I'd use or try phing, I'm not opposed to it, Capistrano just made sense to me. If you have a shell phing environment I can test with, I wouldn't mind adding that to the project, and changing the name to wordpress-automated or something.

    Does Phing allow you to manage a server? I've seen people use the moonshine plugin to handle package management and server configuration, which is really sexy for me. It's like cfconfig, but better documented and very easy to use.
  • psst...you might want to include the link to the github project :)
    http://github.com/vluther/wordpress-capistrano/
blog comments powered by Disqus

Previous post:

Next post: