A few months ago I made a tool called Scatter to help automate deploys and keep them separated from code. This weekend I completely rewrote it in Ruby (from Python) and added some new features (install it with
gem install scatter_deploy). One of those new features is shared deploy scripts, which turns out to be a really handy way to deploy WordPress plugins from Git to WordPress.org. I made a 5 minute screencast that shows the process of deploying and updating a WordPress.org plugin without ever touching SVN.
First, a bit of background. WordPress.org’s plugin system uses Subversion. I use Git for all of my projects. While there are a bunch of ways to communicate between the two systems, they’ve all been varying degrees of annoying for me. For a while I was using this workflow from Boone Gorges based on
git-svn. It had some big problems though — it’s slow, and it causes huge problems when you try to do things in Git that SVN doesn’t understand (like use submodules). As a result, even Boone doesn’t actually use that Workflow anymore. I also considered this workflow from Daniel Bachhuber, which basically handles the problem by creating two repos in the same “place”. That felt very manual and error-prone though.
When I added support for shared deploy scripts in Scatter, I decided to use that to automate this whole plugin process. I started with Ben Balter’s plugin deploy script and made a few small changes to (1) add some safety checks and (2) build in assumptions that fit Scatter’s process. The result is that I can now run
scatter -s wp from anywhere inside a WordPress plugin Git repository, and have everything just work. You can see some more details in the Scatter Deploy Examples readme.
This is not the only thing that Scatter does — it’s a more general deploy tool — but it’s one of the use cases that I think is pretty cool.