Changeset 840


Ignore:
Timestamp:
Aug 26, 2010, 11:42:06 AM (8 years ago)
Author:
duh
Message:

updated CI script

File:
1 moved

Legend:

Unmodified
Added
Removed
  • misc/scripts/continuous_integration.sh

    r838 r840  
    2626# $Date$
    2727# $Rev$
     28
     29if [ $1 ]; then
     30# set project
     31        PROJECT=$1
     32else
     33        echo "Usage: $0 <projectname>"
     34        exit;
     35fi
    2836
    2937# Platform specific configuration
     
    4351        GRAILS_INSTALL_PATH=/app
    4452        PATH_TOMCAT_WEBAPPS=/home/tomcat/apache-tomcat/webapps
    45         APACHE_VHOST_FILES=/etc/apache2/sites-available/nmcdsp.org_gscf.conf
     53        APACHE_VHOST_FILES=/etc/apache2/sites-available/nmcdsp.org_$PROJECT.conf
    4654        TOMCAT_STOP="/home/tomcat/apache-tomcat/bin/shutdown.sh"
    4755        TOMCAT_START="/home/tomcat/apache-tomcat/bin/startup.sh"
     
    5361
    5462# GENERIC CONFIGURATION
     63export CATALINA_OPTS="-Xms4096m -Xmx4096m -XX:MaxPermSize=2048m -XX:MaxHeapFreeRatio=70 -XX:MaxGCPauseMillis=10 -XX:+UseConcMarkSweepGC"
    5564export GRAILS_HOME=$GRAILS_INSTALL_PATH/grails
    5665export JDK_HOME=$JAVA_HOME
     
    5867export PATH=$HOME/grails/bin:$PATH
    5968STAMP=`date +'%Y%m%d%H%M'`
    60 PROJECT=gscf
    6169USER=`/usr/bin/whoami`
    62 PATH_GRAILS_SOURCE=$HOME/workspace/gscf
     70PATH_GRAILS_SOURCE=$HOME/workspace/$PROJECT
    6371TEMP=$HOME/tmp
    6472SVN=`which svn`
     
    157165        # switch to source dir
    158166        cd $PATH_GRAILS_SOURCE
     167
     168        GRAILS_UPGRADED=1
     169else
     170        GRAILS_UPGRADED=0
    159171fi
    160172
     
    174186done
    175187
     188# upgrade project to new grails version?
     189if [ $GRAILS_UPGRADED -eq 1 ]; then
     190        echo ".upgrade grails project"
     191        grails upgrade --non-interactive --quiet
     192fi
     193
    176194# uninstall development plugins
    177195index=0
    178196while [ "$index" -lt "${#DEV_PLUGINS[@]}" ]
    179197do
    180         PLUGIN_INSTALLED=`find $HOME/.grails/$GRAILS_VERSION/projects/gscf/plugins/ -maxdepth 1|grep -i ${DEV_PLUGINS[index]}|wc -l`
     198        PLUGIN_INSTALLED=`find $HOME/.grails/$GRAILS_VERSION/projects/$PROJECT/plugins/ -maxdepth 1|grep -i ${DEV_PLUGINS[index]}|wc -l`
    181199        if [ "$PLUGIN_INSTALLED" -gt "0" ]; then
    182200                echo $STAMP uninstalling ${DEV_PLUGINS[index]} plugin
     
    189207echo $STAMP patching index page...
    190208sed -i 's/<\/b>/<\/b> \(<font color="red">svn revision: '$SVN_REVISION', deployed at: '$STAMP'<\/font>\)/g' grails-app/views/home/index.gsp
    191 sed -i 's/Welcome to GSCF version/Welcome to the <b>continuous integration build<\/b> of GSCF/g' grails-app/views/home/index.gsp
     209sed -i 's/Welcome to $PROJECT version/Welcome to the <b>continuous integration build<\/b> of $PROJECT/g' grails-app/views/home/index.gsp
    192210
    193211# build new war
     
    196214
    197215# undeploying gscf releases
    198 rm -rf $PATH_TOMCAT_WEBAPPS/gscf*
     216rm -rf $PATH_TOMCAT_WEBAPPS/$PROJECT*
    199217
    200218# deploying new build
    201219echo $STAMP deploying new production WAR
    202 cp target/gscf-$APP_VERSION.war $PATH_TOMCAT_WEBAPPS
     220cp target/$PROJECT-$APP_VERSION.war $PATH_TOMCAT_WEBAPPS
    203221
    204222# start tomcat
     
    212230# fix virtual host files
    213231echo $STAMP updating apache virtual host configuration
    214 ls $APACHE_VHOST_FILES|xargs -i sed -i 's/gscf-[0-9]\.[0-9]\.[0-9]/gscf-'$APP_VERSION'/g' {}
     232ls $APACHE_VHOST_FILES|xargs -i sed -i 's/'$PROJECT'-[0-9]\.[0-9]\.[0-9]/'$PROJECT'-'$APP_VERSION'/g' {}
    215233
    216234# restart apache
Note: See TracChangeset for help on using the changeset viewer.