Plugin Directory

Changeset 2168760


Ignore:
Timestamp:
10/05/2019 01:36:13 PM (6 years ago)
Author:
mikepsinn
Message:

Deploy to WordPress.org via Jenkins

Location:
quantimodo/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • quantimodo/trunk

    • Property svn:ignore
      •  

        old new  
        11deploy.sh
        2 README.md
        32.git
        43.gitignore
  • quantimodo/trunk/.travis.yml

    r1791904 r2168760  
    2020    - npm test
    2121
    22 after_success: sh ./scripts/deploy.sh
     22after_success:
     23    #- sh ./scripts/deploy.sh
     24  - echo "See http://quantimodo2.asuscomm.com:8082/view/all/job/wordpress-plugin-release for deployment"
    2325
    2426env:
  • quantimodo/trunk/quantimodo.php

    r2125568 r2168760  
    22/*
    33 * Plugin Name: QuantiModo
    4  * Version: 0.5.8
     4 * Version: 0.5.9
    55 * Description: Allow your users to record, aggregate, analyze and visualize their health and life-tracking data.
    66 * Author: QuantiModo
  • quantimodo/trunk/readme.txt

    r2125568 r2168760  
    33Tags: social, science, quantified self, mood tracking, digital health, healthcare, mental health
    44Requires at least: 4.3
    5 Stable tag: 0.5.8
     5Stable tag: 0.5.9
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • quantimodo/trunk/scripts/deploy.sh

    r1791900 r2168760  
    11#!/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...
     2if [[ -z ${WP_ORG_PASSWORD} ]]; then echo "Please set WP_ORG_PASSWORD env" && exit 1; fi
     3if [[ -z ${WP_ORG_USERNAME} ]]; then echo "Please set WP_ORG_USERNAME env" && exit 1; fi
     4PLUGIN_SLUG="quantimodo"
     5CURRENT_DIR=`pwd`
     6MAIN_FILE="$PLUGIN_SLUG.php" # this should be the name of your main php file in the wordpress plugin
     7GIT_PATH="$CURRENT_DIR" # this file should be in the base of your git repository
     8SVN_PATH="/tmp/$PLUGIN_SLUG" # path to a temp SVN repo. No trailing slash required and don't add trunk.
     9SVN_URL="http://plugins.svn.wordpress.org/$PLUGIN_SLUG/" # Remote SVN repo on wordpress.org, with no trailing slash
     10COMMIT_MSG="Deploy to WordPress.org via Jenkins"
    2011echo ".........................................."
    21 echo
    2212echo "Preparing to deploy wordpress plugin"
    23 echo
    2413echo ".........................................."
    25 echo
    26 
    2714# 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 
     15NEW_VERSION1=`grep "^Stable tag" ${GIT_PATH}/README.md | awk -F':' '{print $2}' | tr -d ' '`
     16echo "readme version: $NEW_VERSION1"
     17NEW_VERSION2=`grep "Version:" ${GIT_PATH}/${MAIN_FILE} | awk -F':' '{print $2}' | tr -d ' '`
     18echo "$MAIN_FILE version: $NEW_VERSION2"
     19if [[ "$NEW_VERSION1" != "$NEW_VERSION2" ]]; then echo "Versions don't match. Exiting...."; exit 1; fi
     20echo "Versions match in readme.txt and PHP file. Let's proceed..."
    3721echo
    3822echo "Creating local copy of SVN repo ..."
    39 svn co ${SVNURL} ${SVNPATH}
    40 
     23svn co ${SVN_URL} ${SVN_PATH}
    4124echo "Exporting the HEAD of master from git to the trunk of SVN"
    42 git checkout-index -a -f --prefix=${SVNPATH}/trunk/
    43 
     25git checkout-index -a -f --prefix=${SVN_PATH}/trunk/
    4426echo "Ignoring github specific & deployment script"
    4527svn propset svn:ignore "deploy.sh
    4628.git
    47 .gitignore" "$SVNPATH/trunk/"
    48 
    49 if [ ! -d "$SVNPATH/assets/" ]; then
     29.gitignore" "$SVN_PATH/trunk/"
     30if [[ ! -d "$SVN_PATH/assets/" ]]; then
    5031    echo "Moving assets-wp-repo"
    51     mkdir ${SVNPATH}/assets/
    52     mv ${SVNPATH}/trunk/assets-wp-repo/* ${SVNPATH}/assets/
    53     svn add ${SVNPATH}/assets/
    54     svn delete ${SVNPATH}/trunk/assets-wp-repo
     32    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
    5536fi
    56 
    5737# Create WP.org readme.txt
    58 if [ -f "${SVNPATH}/trunk/README.md" ]; then
    59     mv "${SVNPATH}/trunk/README.md" "${SVNPATH}/trunk/readme.txt"
     38if [[ -f "${SVN_PATH}/trunk/README.md" ]]; then
     39    mv "${SVN_PATH}/trunk/README.md" "${SVN_PATH}/trunk/readme.txt"
    6040    sed -i.bak \
    6141        -e 's/^# \(.*\)$/=== \1 ===/' \
     
    6545        -e 's/^### \(.*\)$/= \1 =/' \
    6646        -e 's/ #* =$/ =/' \
    67         "${SVNPATH}/trunk/readme.txt"
     47        "${SVN_PATH}/trunk/readme.txt"
    6848    # Remove the sed backup file
    69     rm "${SVNPATH}/trunk/readme.txt.bak"
     49    rm "${SVN_PATH}/trunk/readme.txt.bak"
    7050fi
    71 
    7251echo "Changing directory to SVN"
    73 cd ${SVNPATH}/trunk/
     52cd ${SVN_PATH}/trunk/
    7453# Add all new files that are not set to be ignored
    7554echo "committing to trunk"
    76 svn commit --username=${WP_ORG_USERNAME} --password=${WP_ORG_PASSWORD} -m "$COMMITMSG" --no-auth-cache
    77 
     55svn commit --username=${WP_ORG_USERNAME} --password=${WP_ORG_PASSWORD} -m "$COMMIT_MSG" --no-auth-cache
    7856echo "Updating WP plugin repo assets & committing"
    79 cd ${SVNPATH}/assets/
     57cd ${SVN_PATH}/assets/
    8058svn 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/" ];
     59echo "Check if tagged version $NEW_VERSION1 exists"
     60cd ${SVN_PATH}
     61if [[ ! -d "$SVN_PATH/tags/$NEW_VERSION1/" ]];
    8562    then
    8663        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
    9070    else
    91         echo "tagged version $NEWVERSION1 already exists!"
     71        echo "tagged version $NEW_VERSION1 already exists!"
    9272        exit 1
    9373fi
    94 
    95 echo "Removing temporary directory $SVNPATH"
    96 rm -fr ${SVNPATH}/
    97 
     74#echo "Removing temporary directory $SVN_PATH"
     75#rm -fr ${SVN_PATH}/
    9876echo "*** FIN ***"
Note: See TracChangeset for help on using the changeset viewer.