You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 10, 2023. It is now read-only.
# Github to WordPress Plugin Directory Deployment Script, Git-Flow Version
2
+
3
+
Deploys a WordPress plugin from Github (git) to the WordPress Plugin Repostiory (svn), taking account of standard [git-flow](https://github.com/nvie/gitflow) usage.
4
+
5
+
## Credits
6
+
Well over 90% of this script was written by others:
-**[Brent Shepherd](https://twitter.com/thenbrent)** - [Avoids permanent local SVN repo, avoids sending redundant stuff to WP repo](http://thereforei.am/2011/04/21/git-to-svn-automated-wordpress-plugin-deployment/)
10
+
-**[Patrick Rauland](https://twitter.com/BFTrick)** - [Support for WP assets folder for plugin page banner and screenshots](https://github.com/BFTrick/jotform-integration/blob/master/deploy.sh)
11
+
-**[Ben Balter](https://twitter.com/benbalter)** - [Submodules support and plugin slug prompt](https://github.com/benbalter/Github-to-WordPress-Plugin-Directory-Deployment-Script/)
12
+
-**[Gary Jones](https://twitter.com/GaryJ)***(me)* - [Personalisation and commenting out bits not required when using git-flow](https://github.com/GaryJones/wordpress-plugin-git-flow-svn-deploy)
13
+
14
+
## Process
15
+
1. Prompts for plugin slug.
16
+
- Verifies plugin header version number matches readme stable version number.
17
+
- Pushes latest git commit and tags to GitHub.
18
+
- Creates temporary checkout of SVN repo.
19
+
- Ignores non-WordPress repo files from SVN.
20
+
- Copies git export to SVN trunk.
21
+
- Checks out any submodules.
22
+
- Copies contents of assets directory in trunk to a directory parallel to trunk.
23
+
- Commits SVN trunk, assets and tag.
24
+
- Attempts to remove temporary SVN checkout.
25
+
26
+
## Usage
27
+
With [git-flow](https://github.com/nvie/gitflow), 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.
28
+
29
+
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, and sit back as the code is sent to SVN and git repos including tags. The commit messages here are hard-coded for consistency.
# See https://github.com/GaryJones/wordpress-plugin-git-flow-svn-deploy for instructions and credits.
3
+
4
+
echo -e "Plugin Slug: \c"
5
+
read PLUGINSLUG
6
+
7
+
# main config
8
+
CURRENTDIR=`pwd`
9
+
PLUGINDIR="$CURRENTDIR/$PLUGINSLUG"
10
+
MAINFILE="$PLUGINSLUG.php"# this should be the name of your main PHP file in the WordPress plugin
11
+
12
+
# git config
13
+
GITPATH="$PLUGINDIR/"# this file should be in the base of your git repository
14
+
15
+
# svn config
16
+
SVNPATH="/tmp/$PLUGINSLUG"# path to a temp SVN repo. No trailing slash required and don't add trunk.
17
+
SVNURL="http://plugins.svn.wordpress.org/$PLUGINSLUG"# Remote SVN repo on WordPress.org, with no trailing slash
18
+
SVNUSER="GaryJ"# your svn username
19
+
20
+
# Let's begin...
21
+
echo".........................................."
22
+
echo
23
+
echo"Preparing to deploy WordPress plugin"
24
+
echo
25
+
echo".........................................."
26
+
echo
27
+
28
+
# Check version in readme.txt is the same as plugin file after translating both to unix line breaks to work around grep's failure to identify mac line breaks
0 commit comments