Changeset 2168760
- Timestamp:
- 10/05/2019 01:36:13 PM (6 years ago)
- Location:
- quantimodo/trunk
- Files:
-
- 5 edited
-
. (modified) (1 prop)
-
.travis.yml (modified) (1 diff)
-
quantimodo.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
scripts/deploy.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
quantimodo/trunk
- Property svn:ignore
-
old new 1 1 deploy.sh 2 README.md3 2 .git 4 3 .gitignore
-
- Property svn:ignore
-
quantimodo/trunk/.travis.yml
r1791904 r2168760 20 20 - npm test 21 21 22 after_success: sh ./scripts/deploy.sh 22 after_success: 23 #- sh ./scripts/deploy.sh 24 - echo "See http://quantimodo2.asuscomm.com:8082/view/all/job/wordpress-plugin-release for deployment" 23 25 24 26 env: -
quantimodo/trunk/quantimodo.php
r2125568 r2168760 2 2 /* 3 3 * Plugin Name: QuantiModo 4 * Version: 0.5. 84 * Version: 0.5.9 5 5 * Description: Allow your users to record, aggregate, analyze and visualize their health and life-tracking data. 6 6 * Author: QuantiModo -
quantimodo/trunk/readme.txt
r2125568 r2168760 3 3 Tags: social, science, quantified self, mood tracking, digital health, healthcare, mental health 4 4 Requires at least: 4.3 5 Stable tag: 0.5. 85 Stable tag: 0.5.9 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
quantimodo/trunk/scripts/deploy.sh
r1791900 r2168760 1 1 #!/usr/bin/env bash 2 # In your Jenkins job configuration, select "Add build step > Execute shell", and paste this script contents. 3 # Replace `______your-plugin-name______`, `______your-wp-username______` and `______your-wp-password______` as needed. 4 5 # main config 6 PLUGINSLUG="quantimodo" 7 CURRENTDIR=`pwd` 8 MAINFILE="$PLUGINSLUG.php" # this should be the name of your main php file in the wordpress plugin 9 10 # git config 11 GITPATH="$CURRENTDIR" # this file should be in the base of your git repository 12 13 # svn config 14 SVNPATH="/tmp/$PLUGINSLUG" # path to a temp SVN repo. No trailing slash required and don't add trunk. 15 SVNURL="http://plugins.svn.wordpress.org/$PLUGINSLUG/" # Remote SVN repo on wordpress.org, with no trailing slash 16 COMMITMSG="Deploy to WordPress.org via Jenkins" 17 18 19 # Let's begin... 2 if [[ -z ${WP_ORG_PASSWORD} ]]; then echo "Please set WP_ORG_PASSWORD env" && exit 1; fi 3 if [[ -z ${WP_ORG_USERNAME} ]]; then echo "Please set WP_ORG_USERNAME env" && exit 1; fi 4 PLUGIN_SLUG="quantimodo" 5 CURRENT_DIR=`pwd` 6 MAIN_FILE="$PLUGIN_SLUG.php" # this should be the name of your main php file in the wordpress plugin 7 GIT_PATH="$CURRENT_DIR" # this file should be in the base of your git repository 8 SVN_PATH="/tmp/$PLUGIN_SLUG" # path to a temp SVN repo. No trailing slash required and don't add trunk. 9 SVN_URL="http://plugins.svn.wordpress.org/$PLUGIN_SLUG/" # Remote SVN repo on wordpress.org, with no trailing slash 10 COMMIT_MSG="Deploy to WordPress.org via Jenkins" 20 11 echo ".........................................." 21 echo22 12 echo "Preparing to deploy wordpress plugin" 23 echo24 13 echo ".........................................." 25 echo26 27 14 # Check version in readme.txt is the same as plugin file 28 NEWVERSION1=`grep "^Stable tag" ${GITPATH}/README.md | awk -F':' '{print $2}' | tr -d ' '` 29 echo "readme version: $NEWVERSION1" 30 NEWVERSION2=`grep "Version:" ${GITPATH}/${MAINFILE} | awk -F':' '{print $2}' | tr -d ' '` 31 echo "$MAINFILE version: $NEWVERSION2" 32 33 #if [ "$NEWVERSION1" != "$NEWVERSION2" ]; then echo "Versions don't match. Exiting...."; exit 1; fi 34 35 #echo "Versions match in readme.txt and PHP file. Let's proceed..." 36 15 NEW_VERSION1=`grep "^Stable tag" ${GIT_PATH}/README.md | awk -F':' '{print $2}' | tr -d ' '` 16 echo "readme version: $NEW_VERSION1" 17 NEW_VERSION2=`grep "Version:" ${GIT_PATH}/${MAIN_FILE} | awk -F':' '{print $2}' | tr -d ' '` 18 echo "$MAIN_FILE version: $NEW_VERSION2" 19 if [[ "$NEW_VERSION1" != "$NEW_VERSION2" ]]; then echo "Versions don't match. Exiting...."; exit 1; fi 20 echo "Versions match in readme.txt and PHP file. Let's proceed..." 37 21 echo 38 22 echo "Creating local copy of SVN repo ..." 39 svn co ${SVNURL} ${SVNPATH} 40 23 svn co ${SVN_URL} ${SVN_PATH} 41 24 echo "Exporting the HEAD of master from git to the trunk of SVN" 42 git checkout-index -a -f --prefix=${SVNPATH}/trunk/ 43 25 git checkout-index -a -f --prefix=${SVN_PATH}/trunk/ 44 26 echo "Ignoring github specific & deployment script" 45 27 svn propset svn:ignore "deploy.sh 46 28 .git 47 .gitignore" "$SVNPATH/trunk/" 48 49 if [ ! -d "$SVNPATH/assets/" ]; then 29 .gitignore" "$SVN_PATH/trunk/" 30 if [[ ! -d "$SVN_PATH/assets/" ]]; then 50 31 echo "Moving assets-wp-repo" 51 mkdir ${SVN PATH}/assets/52 mv ${SVN PATH}/trunk/assets-wp-repo/* ${SVNPATH}/assets/53 svn add ${SVN PATH}/assets/54 svn delete ${SVN PATH}/trunk/assets-wp-repo32 mkdir ${SVN_PATH}/assets/ 33 mv ${SVN_PATH}/trunk/assets-wp-repo/* ${SVN_PATH}/assets/ 34 svn add ${SVN_PATH}/assets/ 35 svn delete ${SVN_PATH}/trunk/assets-wp-repo 55 36 fi 56 57 37 # Create WP.org readme.txt 58 if [ -f "${SVNPATH}/trunk/README.md"]; then59 mv "${SVN PATH}/trunk/README.md" "${SVNPATH}/trunk/readme.txt"38 if [[ -f "${SVN_PATH}/trunk/README.md" ]]; then 39 mv "${SVN_PATH}/trunk/README.md" "${SVN_PATH}/trunk/readme.txt" 60 40 sed -i.bak \ 61 41 -e 's/^# \(.*\)$/=== \1 ===/' \ … … 65 45 -e 's/^### \(.*\)$/= \1 =/' \ 66 46 -e 's/ #* =$/ =/' \ 67 "${SVN PATH}/trunk/readme.txt"47 "${SVN_PATH}/trunk/readme.txt" 68 48 # Remove the sed backup file 69 rm "${SVN PATH}/trunk/readme.txt.bak"49 rm "${SVN_PATH}/trunk/readme.txt.bak" 70 50 fi 71 72 51 echo "Changing directory to SVN" 73 cd ${SVN PATH}/trunk/52 cd ${SVN_PATH}/trunk/ 74 53 # Add all new files that are not set to be ignored 75 54 echo "committing to trunk" 76 svn commit --username=${WP_ORG_USERNAME} --password=${WP_ORG_PASSWORD} -m "$COMMITMSG" --no-auth-cache 77 55 svn commit --username=${WP_ORG_USERNAME} --password=${WP_ORG_PASSWORD} -m "$COMMIT_MSG" --no-auth-cache 78 56 echo "Updating WP plugin repo assets & committing" 79 cd ${SVN PATH}/assets/57 cd ${SVN_PATH}/assets/ 80 58 svn commit --username=${WP_ORG_USERNAME} --password=${WP_ORG_PASSWORD} -m "Updating wp-repo-assets" --no-auth-cache 81 82 echo "Check if tagged version $NEWVERSION1 exists" 83 cd ${SVNPATH} 84 if [ ! -d "$SVNPATH/tags/$NEWVERSION1/" ]; 59 echo "Check if tagged version $NEW_VERSION1 exists" 60 cd ${SVN_PATH} 61 if [[ ! -d "$SVN_PATH/tags/$NEW_VERSION1/" ]]; 85 62 then 86 63 echo "Creating new SVN tag & committing it" 87 svn copy trunk/ tags/${NEWVERSION1}/ 88 cd ${SVNPATH}/tags/${NEWVERSION1} 89 svn commit --username=${WP_ORG_USERNAME} --password=${WP_ORG_PASSWORD} -m "Tagging version $NEWVERSION1" --no-auth-cache 64 svn copy trunk/ tags/${NEW_VERSION1}/ 65 cd ${SVN_PATH}/tags/${NEW_VERSION1} 66 if [[ ! -f includes/integration.js ]]; then 67 echo "integration.js not found!" && exit 1; 68 fi 69 svn commit --username=${WP_ORG_USERNAME} --password=${WP_ORG_PASSWORD} -m "Tagging version $NEW_VERSION1" --no-auth-cache 90 70 else 91 echo "tagged version $NEW VERSION1 already exists!"71 echo "tagged version $NEW_VERSION1 already exists!" 92 72 exit 1 93 73 fi 94 95 echo "Removing temporary directory $SVNPATH" 96 rm -fr ${SVNPATH}/ 97 74 #echo "Removing temporary directory $SVN_PATH" 75 #rm -fr ${SVN_PATH}/ 98 76 echo "*** FIN ***"
Note: See TracChangeset
for help on using the changeset viewer.