Changeset 837


Ignore:
Timestamp:
Aug 25, 2010, 4:31:51 PM (8 years ago)
Author:
duh
Message:

.added support for nmcdsp.org server in continious integration script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/scripts/gscf_continuous_integration.sh

    r828 r837  
    55# - checkout the latest source code from svn
    66# - check if the grails version matches (if not, it downloads and
    7 #   installs that particular grails release to /home/tomcat and
     7#   installs that particular grails release to $HOME and
    88#   updates the symbolic link ~/grails to the new release)
    99# - build a production war, undeploy the old release and deploy the
     
    2727# $Rev$
    2828
    29 # GRAILS CONFIG
    30 export JAVA_HOME=/etc/java-config-2/current-system-vm
    31 export JAVAC=/etc/java-config-2/current-system-vm/bin/javac
    32 export JDK_HOME=/etc/java-config-2/current-system-vm
    33 export GRAILS_HOME=/home/tomcat/grails
    34 export PATH=/home/tomcat/grails/bin:$PATH
    35 
    36 # CONFIGURATION
     29# Platform specific configuration
     30if [ -f /etc/gentoo-release ]; then
     31        # GENTOO
     32        export JAVA_HOME=/etc/java-config-2/current-system-vm
     33        GRAILS_INSTALL_PATH=$HOME
     34        PATH_TOMCAT_WEBAPPS=/var/lib/tomcat-6/webapps/
     35        APACHE_VHOST_FILES=/etc/apache2/vhosts.d/dbnp.org_ci.conf
     36        TOMCAT_STOP="sudo /etc/init.d/tomcat-6 stop"
     37        TOMCAT_START="sudo /etc/init.d/tomcat-6 start"
     38elif [ -f /etc/debian_version ]; then
     39        # DEBIAN
     40        export JAVA_HOME=/usr/lib/jvm/java-6-sun
     41        export GRAILS_HOME=/app/grails
     42        GRAILS_INSTALL_PATH=/app
     43        PATH_TOMCAT_WEBAPPS=/home/tomcat/apache-tomcat/webapps
     44        APACHE_VHOST_FILES=/etc/apache2/sites-available/nmcdsp.org_gscf.conf
     45        TOMCAT_STOP="/home/tomcat/apache-tomcat/bin/shutdown.sh"
     46        TOMCAT_START="/home/tomcat/apache-tomcat/bin/startup.sh"
     47else
     48        echo Could not determine platform....
     49        exit
     50fi
     51
     52# GENERIC CONFIGURATION
     53export GRAILS_HOME=$GRAILS_INSTALL_PATH/grails
     54export JDK_HOME=$JAVA_HOME
     55export JAVAC=$JAVA_HOME/bin/javac
     56export PATH=$HOME/grails/bin:$PATH
    3757STAMP=`date +'%Y%m%d%H%M'`
    3858PROJECT=gscf
    3959USER=`/usr/bin/whoami`
    40 PATH_TOMCAT_WEBAPPS=/var/lib/tomcat-6/webapps/
    41 PATH_GRAILS_SOURCE=/home/tomcat/workspace/gscf
    42 TEMP=/home/tomcat/tmp
     60PATH_GRAILS_SOURCE=$HOME/workspace/gscf
     61TEMP=$HOME/tmp
    4362SVN=`which svn`
    44 APACHE_VHOST_FILES=/etc/apache2/vhosts.d/dbnp.org_ci.conf
    4563DEV_PLUGINS=( db-util nadd-neutralizer )
    4664
     
    5371
    5472# is the update locked?
    55 if [ -f $TEMP/$PROJECT.locked ]
    56 then
     73if [ -f $TEMP/$PROJECT.locked ]; then
    5774        echo $STAMP project deployment is still happening
    5875        exit;
     
    6582cd $PATH_GRAILS_SOURCE
    6683$SVN revert --recursive --quiet *
    67 $SVN update * --quiet *
    68 SVN_REVISION=`$SVN update . | sed -n 's/At revision \(.*\)\./\1/p'`
     84#$SVN update --quiet *
     85#SVN_REVISION=`$SVN update .| sed -n 's/At revision \(.*\)\./\1/p'`
     86SVN_REVISION=`$SVN update|sed -n 's/At revision \(.*\)\./\1/p'`
    6987RUNNING_REVISION=`cat $TEMP/$PROJECT.revision`
    7088
    7189# got an SVN revision?
    72 if [ "$SVN_REVISION" = "" ];
    73 then
     90if [ "$SVN_REVISION" = "" ]; then
    7491        echo $STAMP haven\'t got an svn revision?
    7592        rm $TEMP/$PROJECT.locked
     
    7895
    7996# is a new revision available?
    80 if [ "$RUNNING_REVISION" == "$SVN_REVISION" ]
    81 then
     97if [ "$RUNNING_REVISION" == "$SVN_REVISION" ]; then
    8298        #echo $STAMP do nothing...
    8399        rm $TEMP/$PROJECT.locked
     
    104120
    105121# see if this grails version is available
    106 if [ ! -d "/home/tomcat/grails-"$GRAILS_VERSION ]
     122if [ ! -d $GRAILS_INSTALL_PATH/grails-$GRAILS_VERSION ]
    107123then
    108124        echo $STAMP "grails version "$GRAILS_VERSION" is not installed."
    109125
    110         cd ~
     126        cd $GRAILS_INSTALL_PATH
    111127        ls -1 ~|grep grails|grep zip|xargs -i rm ~/{}
    112128       
     
    119135                echo $STAMP "could not download and install grails "$GRAILS_VERSION
    120136                echo $STAMP "do it manually instead and update the symbolic link..."
     137
     138                # remove lock file
     139                if [ -f $TEMP/$PROJECT.locked ]
     140                then
     141                        rm $TEMP/$PROJECT.locked
     142                fi
    121143                exit;
    122144        fi
     
    144166index=0
    145167while [ "$index" -lt "3" ]; do
    146         sudo /etc/init.d/tomcat-6 stop > /dev/null
     168        #sudo /etc/init.d/tomcat-6 stop > /dev/null
     169        $TOMCAT_STOP > /dev/null 2>&1
    147170        sleep 10
    148171        ((index++))
     
    153176while [ "$index" -lt "${#DEV_PLUGINS[@]}" ]
    154177do
    155         PLUGIN_INSTALLED=`find /home/tomcat/.grails/$GRAILS_VERSION/projects/gscf/plugins/ -maxdepth 1|grep -i ${DEV_PLUGINS[index]}|wc -l`
     178        PLUGIN_INSTALLED=`find $HOME/.grails/$GRAILS_VERSION/projects/gscf/plugins/ -maxdepth 1|grep -i ${DEV_PLUGINS[index]}|wc -l`
    156179        if [ "$PLUGIN_INSTALLED" -gt "0" ]; then
    157180                echo $STAMP uninstalling ${DEV_PLUGINS[index]} plugin
     
    182205#  -somehow- make the sudo commands fail)
    183206echo $STAMP starting tomcat...
    184 sudo /etc/init.d/tomcat-6 start > /dev/null
     207#sudo /etc/init.d/tomcat-6 start > /dev/null
     208$TOMCAT_START > /dev/null 2>&1
    185209
    186210# fix virtual host files
Note: See TracChangeset for help on using the changeset viewer.