Deploys a WordPress plugin from Github (git) to the WordPress Plugin Repostiory (svn), taking account of standard git-flow usage.
Well over 90% of this script was written by others:
- Dean Clatworthy - Original script
- Brent Shepherd - Avoids permanent local SVN repo, avoids sending redundant stuff to WP repo
- Patrick Rauland - Support for WP assets folder for plugin page banner and screenshots
- Ben Balter - Submodules support and plugin slug prompt
- Gary Jones (me) - Personalisation and commenting out bits not required when using git-flow
- Prompts for plugin slug and other data.
- Verifies plugin header version number matches readme stable version number.
- Pushes latest git commit and tags to GitHub.
- Creates temporary checkout of SVN repo.
- Ignores non-WordPress repo files from SVN.
- Copies git export to SVN trunk.
- Checks out any submodules.
- Copies contents of assets directory in trunk to a directory parallel to trunk.
- Commits SVN trunk, assets and tag.
- Attempts to remove temporary SVN checkout.
With git-flow, specifically the git flow release finish ...
command, the release branch is merged into the develop branch, the master branch and a tag is created, so these aren't needed with this deploy script.
I prefer to keep this script in the root of my projects directory. Each project directory is named as the plugin slug, as is the corresponding GitHub repo. To use, just call the script, enter the plugin slug, confirm or amend default suggestions, and sit back as the code is sent to SVN and git repos including tags. The commit messages here are hard-coded for consistency.