From db13bf7b9ae11b747c97ae8e1cac65e3984c6902 Mon Sep 17 00:00:00 2001 From: "R.Brown" Date: Mon, 16 Dec 2013 14:21:21 +0100 Subject: [PATCH] - test and approve plugin for WordPress 3.8 --- credit-tracker-deploy.sh | 166 +++++++++++++++++++++++++++++++++++++++ credit-tracker.php | 2 +- css/ct-admin.css | 8 +- readme.txt | 4 +- 4 files changed, 176 insertions(+), 4 deletions(-) create mode 100755 credit-tracker-deploy.sh diff --git a/credit-tracker-deploy.sh b/credit-tracker-deploy.sh new file mode 100755 index 0000000..79c6f64 --- /dev/null +++ b/credit-tracker-deploy.sh @@ -0,0 +1,166 @@ +#! /bin/bash +# See https://github.com/GaryJones/wordpress-plugin-git-flow-svn-deploy for instructions and credits. + +echo +echo "WordPress Plugin Git-Flow SVN Deploy v1.0.1-dev" +echo +echo "Step 1. Let's collect some information first." +echo +echo "Default values are in brackets - just hit enter to accept them." +echo + +# Get some user input +# Can't use the -i flag for read, since that doesn't work for bash 3 + +default_pluginslug="credit-tracker" + +echo "1a) WordPress Repo Plugin Slug." +read -e -p "Plugin Slug ($default_pluginslug): " input +PLUGINSLUG="${input:-$default_pluginslug}" +echo + +# Set up some default values. Feel free to change these in your own script +CURRENTDIR=`pwd` +default_svnpath="$CURRENTDIR/../$PLUGINSLUG-svn" +default_svnurl="http://plugins.svn.wordpress.org/$PLUGINSLUG" +default_svnuser="labs64" +default_plugindir="$CURRENTDIR" +default_mainfile="$PLUGINSLUG.php" + +echo "1b) Path to a local directory where a temporary SVN checkout can be made." +read -e -p "No trailing slash and don't add trunk ($default_svnpath): " input +SVNPATH="${input:-$default_svnpath}" +echo + +echo "1c) Remote SVN repo on WordPress.org. No trailing slash." +read -e -p "($default_svnurl): " input +SVNURL="${input:-$default_svnurl}" +echo + +read -e -p "1d) Your WordPress repo SVN username ($default_svnuser): " input +SVNUSER="${input:-$default_svnuser}" +echo + +echo "1e) Your local plugin root directory, the Git repo." +read -e -p "($default_plugindir): " input +PLUGINDIR="${input:-$default_plugindir}" +echo + +read -e -p "1f) Name of the main plugin file ($default_mainfile): " input +MAINFILE="${input:-$default_mainfile}" +echo + +echo "That's all of the data collected." +echo +echo "Slug: $PLUGINSLUG" +echo "Temp checkout path: $SVNPATH" +echo "Remote SVN repo: $SVNURL" +echo "SVN username: $SVNUSER" +echo "Plugin directory: $PLUGINDIR" +echo "Main file: $MAINFILE" +echo + +# git config +GITPATH="$PLUGINDIR/" # this file should be in the base of your git repository + +# Let's begin... +echo ".........................................." +echo +echo "Preparing to deploy WordPress plugin" +echo +echo ".........................................." +echo + +# 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 +NEWVERSION1=`grep "^Stable tag:" $GITPATH/readme.txt | awk -F' ' '{print $NF}'` +echo "readme.txt version: $NEWVERSION1" +NEWVERSION2=`grep "Version:" $GITPATH/$MAINFILE | awk -F' ' '{print $NF}'` +echo "$MAINFILE version: $NEWVERSION2" + +if [ "$NEWVERSION1" != "$NEWVERSION2" ]; then echo "Version in readme.txt & $MAINFILE don't match. Exiting...."; exit 1; fi + +echo "Versions match in readme.txt and $MAINFILE. Let's proceed..." + +# GaryJ: Ignore check for git tag, as git flow release finish creates this. +if git show-ref --tags --quiet --verify -- "refs/tags/$NEWVERSION1" + then + echo "Version $NEWVERSION1 already exists as git tag. Exiting...."; + exit 1; + else + echo "Git version does not exist. Let's proceed..." +fi + +echo "Changing to $GITPATH" +cd $GITPATH +# GaryJ: Commit message variable not needed . Hard coded for SVN trunk commit for consistency. +echo -e "Enter a commit message for this new version (e.g. REL-$NEWVERSION1): \c" +read COMMITMSG +# GaryJ: git flow release finish already covers this commit. +git commit -am "$COMMITMSG" + +# GaryJ: git flow release finish already covers this tag creation. +echo "Tagging new version in git" +git tag -a "$NEWVERSION1" -m "Tagging version $NEWVERSION1" + +echo "Pushing git master to origin, with tags" +git push origin master +git push origin master --tags + +echo +echo "Creating local copy of SVN repo ..." +svn checkout $SVNURL $SVNPATH + +echo "Ignoring GitHub specific files" +svn propset svn:ignore "README.md +Thumbs.db +.git +.gitignore" "$SVNPATH/trunk/" + +echo "Exporting the HEAD of master from git to the trunk of SVN" +git checkout-index -a -f --prefix=$SVNPATH/trunk/ + +# If submodule exist, recursively check out their indexes +if [ -f ".gitmodules" ] + then + echo "Exporting the HEAD of each submodule from git to the trunk of SVN" + git submodule init + git submodule update + git submodule foreach --recursive 'git checkout-index -a -f --prefix=$SVNPATH/trunk/$path/' +fi + +##### # Support for the /assets folder on the .org repo. +##### echo "Moving assets" +##### # Make the directory if it doesn't already exist +##### mkdir $SVNPATH/assets/ +##### mv $SVNPATH/trunk/assets/* $SVNPATH/assets/ +##### svn add $SVNPATH/assets/ +##### svn delete $SVNPATH/trunk/assets + +echo "Changing directory to SVN and committing to trunk" +cd $SVNPATH/trunk/ +# Delete all files that should not now be added. +svn status | grep -v "^.[ \t]*\..*" | grep "^\!" | awk '{print $2}' | xargs svn del +# Add all new files that are not set to be ignored +svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2}' | xargs svn add +svn commit --username=$SVNUSER -m "Preparing for $NEWVERSION1 release" + +##### echo "Updating WordPress plugin repo assets and committing" +##### cd $SVNPATH/assets/ +##### # Add all new files that are not set to be ignored +##### svn status | grep -v "^.[ \t]*\..*" | grep "^\!" | awk '{print $2}' | xargs svn del +##### # Add all new files that are not set to be ignored +##### svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2}' | xargs svn add +##### svn commit --username=$SVNUSER -m "Updating assets" + +echo "Creating new SVN tag and committing it" +cd $SVNPATH +svn copy trunk/ tags/$NEWVERSION1/ +cd $SVNPATH/tags/$NEWVERSION1 +svn commit --username=$SVNUSER -m "REL-$NEWVERSION1" + +##### echo "Removing temporary directory $SVNPATH" +cd $SVNPATH +cd .. +##### rm -fr $SVNPATH/ + +echo "*** FIN ***" diff --git a/credit-tracker.php b/credit-tracker.php index 7bb97e5..a789a9f 100755 --- a/credit-tracker.php +++ b/credit-tracker.php @@ -12,7 +12,7 @@ * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt * Requires at least: 3.5.1 - * Tested up to: 3.7.1 + * Tested up to: 3.8 * * @package Credit_Tracker * @author Labs64 diff --git a/css/ct-admin.css b/css/ct-admin.css index 6c38569..9ac01d8 100755 --- a/css/ct-admin.css +++ b/css/ct-admin.css @@ -9,6 +9,12 @@ p { background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QkPFwUYQHUOkAAAAbZJREFUWMPtl80rRFEYh59z7pl8K+OrIQsSKTZkQVkrlpRESlJSsrGytfEPWFlYiZolJQtZsRJZ2CkfmTJoyCjXzL1zLMZHY7pyuVK67+6ec9+3p3vf93d+R5x2V+iEDQhcRcp8pG5lj0B1AydDrVjXEdyGEqASNoSjFsolgGVaTJhJgsDmjcV91HKVr4H2YolCvJC4BEAIxEuO8Y18nS6B5I/DB/AB1Je7VmvHZ62z99ODIrwBqGxsoql3AJ2y34XItsgrrQSgY3yaxEM8I+cucsbB6hLSMH4OEKytp3VkynG/pX8sa+1ib4f95UXwAuDtU5sxksfrCOlcVJY0YITave8BAB2PYG5NIVSu4zuB5tHfA0g3lgHC+ERgpa8DPsA/leJXzdWpBMKWzlOgrd8DECV1FPRtgHAGEAUh7wFeDxURKMSo6friz5XeAVweHbI9PwM69bZmJ5N0Ts6SXxZid2GOp/vbjJz4VRSplDcAsfMzYudLH1yxSdvwBPllIY7WwsQvs235Z2eGP4Y+gA+QMYZap62EO1X+6JLd3w0BVI6EwSrXxghtKopyAwD0lCtsvlFDwzOb9YklvzGQAQAAAABJRU5ErkJggg=='); width: 32px; height: 32px; + float: left; + margin: 8px 8px 0px 0px; +} + +.icon32 { + display: block; } .wrap { @@ -26,7 +32,7 @@ p { .info_menu { float: left; - width: 22%; + width: 20%; background-color: #efefef; padding: 5px 10px 5px 10px; margin-top: 40px; diff --git a/readme.txt b/readme.txt index f81e15d..6c75465 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: labs64 Tags: plugin, shortcode, credit, credits, attribution, legal, copyright, owner, author, media library, media, image, images, photo, photos, license, royalty-free, RF, Creative Commons, CC, stock, attachment, custom fields, fotolia, bildnachweis, impressum, imprint, microdata, NetLicensing Requires at least: 3.5.1 -Tested up to: 3.7.1 +Tested up to: 3.8 Stable tag: 0.9.7 License: GPL-2.0+ License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -127,7 +127,7 @@ Yes you can! Join in on our [GitHub repository](https://github.com/Labs64/credit == Changelog == = 0.9.7 = -* **TODO** +* Test and approve plugin for WordPress 3.8 = 0.9.6 = * Integrate NetLicensing to validate activated plugin features