During my daily commutes through Version Control land, I’d gladly never leave Git’s bountiful pastures. Alas, to deploy my WordPress plugins, I must check-in my code to a Subversion repository on plugins.svn.wordpress.org.
There are a few tutorials floating around the web which help we laymen understand how to make Git & Subversion play nice together. With my number of plugins increasing and having previously worked for an automated build tool developer, I knew I should aspire to one-step deployment.
A quick Google on the matter lead me to Dean Clatworthy’s WordPress Git-SVN Deployment script, which was a great start. Only one problem – it required I keep a copy of the SVN repo locally. I didn’t want to do that – I change computers more often than I change socks.
I also wanted the deployment script to live in each of my plugin’s Git repos (without deploying the script file and GitHub README.md to WordPress.org). So I made a few modifications and thus was born my one-step Git to SVN WordPress Plugin Deployment Script.
To use it, add deploy.sh to the root of your Plugin’s Git repository. Specify a few plugin specific variables at the beginning of the file, then it’s ready to run. Make sure it’s executable (
chmod u+x deploy.sh) and from the command line, you can deploy anytime with:
If you’re not already using an automated deployment for your WordPress plugins I highly recommend it. Since running the script for my plugins, I’ve not suffered the frustrations of minor errors – like having version numbers in the readme.txt & plugin file differ. I’ve lost less time deploying, so I’ve released more frequently, which means fewer bugs in the wild. Win.