Changeset 840
- Timestamp:
- Aug 26, 2010, 11:42:06 AM (13 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
misc/scripts/continuous_integration.sh
r838 r840 26 26 # $Date$ 27 27 # $Rev$ 28 29 if [ $1 ]; then 30 # set project 31 PROJECT=$1 32 else 33 echo "Usage: $0 <projectname>" 34 exit; 35 fi 28 36 29 37 # Platform specific configuration … … 43 51 GRAILS_INSTALL_PATH=/app 44 52 PATH_TOMCAT_WEBAPPS=/home/tomcat/apache-tomcat/webapps 45 APACHE_VHOST_FILES=/etc/apache2/sites-available/nmcdsp.org_ gscf.conf53 APACHE_VHOST_FILES=/etc/apache2/sites-available/nmcdsp.org_$PROJECT.conf 46 54 TOMCAT_STOP="/home/tomcat/apache-tomcat/bin/shutdown.sh" 47 55 TOMCAT_START="/home/tomcat/apache-tomcat/bin/startup.sh" … … 53 61 54 62 # GENERIC CONFIGURATION 63 export CATALINA_OPTS="-Xms4096m -Xmx4096m -XX:MaxPermSize=2048m -XX:MaxHeapFreeRatio=70 -XX:MaxGCPauseMillis=10 -XX:+UseConcMarkSweepGC" 55 64 export GRAILS_HOME=$GRAILS_INSTALL_PATH/grails 56 65 export JDK_HOME=$JAVA_HOME … … 58 67 export PATH=$HOME/grails/bin:$PATH 59 68 STAMP=`date +'%Y%m%d%H%M'` 60 PROJECT=gscf61 69 USER=`/usr/bin/whoami` 62 PATH_GRAILS_SOURCE=$HOME/workspace/ gscf70 PATH_GRAILS_SOURCE=$HOME/workspace/$PROJECT 63 71 TEMP=$HOME/tmp 64 72 SVN=`which svn` … … 157 165 # switch to source dir 158 166 cd $PATH_GRAILS_SOURCE 167 168 GRAILS_UPGRADED=1 169 else 170 GRAILS_UPGRADED=0 159 171 fi 160 172 … … 174 186 done 175 187 188 # upgrade project to new grails version? 189 if [ $GRAILS_UPGRADED -eq 1 ]; then 190 echo ".upgrade grails project" 191 grails upgrade --non-interactive --quiet 192 fi 193 176 194 # uninstall development plugins 177 195 index=0 178 196 while [ "$index" -lt "${#DEV_PLUGINS[@]}" ] 179 197 do 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` 181 199 if [ "$PLUGIN_INSTALLED" -gt "0" ]; then 182 200 echo $STAMP uninstalling ${DEV_PLUGINS[index]} plugin … … 189 207 echo $STAMP patching index page... 190 208 sed -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.gsp209 sed -i 's/Welcome to $PROJECT version/Welcome to the <b>continuous integration build<\/b> of $PROJECT/g' grails-app/views/home/index.gsp 192 210 193 211 # build new war … … 196 214 197 215 # undeploying gscf releases 198 rm -rf $PATH_TOMCAT_WEBAPPS/ gscf*216 rm -rf $PATH_TOMCAT_WEBAPPS/$PROJECT* 199 217 200 218 # deploying new build 201 219 echo $STAMP deploying new production WAR 202 cp target/ gscf-$APP_VERSION.war $PATH_TOMCAT_WEBAPPS220 cp target/$PROJECT-$APP_VERSION.war $PATH_TOMCAT_WEBAPPS 203 221 204 222 # start tomcat … … 212 230 # fix virtual host files 213 231 echo $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' {}232 ls $APACHE_VHOST_FILES|xargs -i sed -i 's/'$PROJECT'-[0-9]\.[0-9]\.[0-9]/'$PROJECT'-'$APP_VERSION'/g' {} 215 233 216 234 # restart apache
Note: See TracChangeset
for help on using the changeset viewer.