Changeset 1113
- Timestamp:
- Nov 10, 2010, 10:33:49 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/scripts/deploy.sh
r1105 r1113 90 90 SVN=`which svn` 91 91 DEV_PLUGINS=( nadd-neutralizer ) 92 MANAGER_URL=http://$TYPE.manager.nmcdsp.org/manager/html/undeploy?path= 92 #MANAGER_URL=http://$TYPE.manager.nmcdsp.org/manager/html/undeploy?path= 93 MANAGER_URL=http://$TYPE.manager.nmcdsp.org/manager/html 93 94 MANAGER_USER=ci 94 95 MANAGER_PASSWORD=berterni3 95 # Keys registered by t.w.abma[at]umcutrecht address (gscf.nmcdsp.org)96 OAUTHKEY=Xhu1RtLtB43yIy29EYw97 OAUTHSECRET=gYO5ps6JLDMEdJLOQkSBoTTbq11s8CrORqvrBkc6k98 99 # Keys registered by t.w.abma[at]gmail address (gscf.nmcdsp.org)100 #OAUTHKEY=M07bnXDthzcbWD7KKSlDYw101 #OAUTHSECRET=odfnT08AUBYhh2z0PVMS9JT11D2jASwGNzAj9YFk7s102 96 103 97 # are we user tomcat? … … 124 118 #SVN_REVISION=`$SVN update .| sed -n 's/At revision \(.*\)\./\1/p'` 125 119 SVN_REVISION=`$SVN update|sed -n 's/At revision \(.*\)\./\1/p'` 120 SVN_REVISION=`$SVN update|sed -n 's/At revision \(.*\)\./\1/p'` 126 121 RUNNING_REVISION=`cat $TEMP/$PROJECT-$TYPE.revision` 127 122 … … 131 126 # builds to stop building because they have 132 127 # the same revision... 128 echo $STAMP setting internal old revision to 0 so that deployment will always happen... 133 129 RUNNING_REVISION=0 134 130 fi … … 235 231 echo $STAMP setting build information variables in application.properties 236 232 TIMESTAMP=`date +'%s'` 237 sed -i 's/app\.build\.type=\w\+/app.build.type= $TYPE/gi' application.properties233 sed -i 's/app\.build\.type=\w\+/app.build.type='$TYPE'/gi' application.properties 238 234 sed -i 's/app\.build\.timestamp=\w\+/app.build.timestamp='$TIMESTAMP'/gi' application.properties 239 235 sed -i 's/app\.build\.svn\.revision=\w\+/app.build.svn.revision='$SVN_REVISION'/gi' application.properties … … 245 241 246 242 # patch datasource.groovy 247 echo $STAMP patching datasource for $TYPE instance248 sed -i 's/5432\/'$PROJECT'/5432\/'$PROJECT'-$TYPE/g' grails-app/conf/DataSource.groovy243 #echo $STAMP patching datasource for $TYPE instance 244 #sed -i 's/5432\/'$PROJECT'/5432\/'$PROJECT'-'$TYPE'/g' grails-app/conf/DataSource.groovy 249 245 250 246 # patch Searchable 251 if [ -f grails-app/conf/Searchable.groovy ]; then 252 echo $STAMP patching searchable configuration for $TYPE instance 253 sed -i 's/$PROJECT/$PROJECT-$TYPE/gi' grails-app/conf/Searchable.groovy 254 fi 255 256 # adding patch for OAuth configuration file (consumer key and consumer secret generated by myExperiment). 257 if [ "$PROJECT" = "gscf" ] 258 then 259 echo $STAMP GSCF project given as argument, patching Config.groovy with OAuth [key:$OAUTHKEY, SECRET:$OAUTHSECRET]... 260 sed -i 's/\$oauthkey\$/'$OAUTHKEY'/gi' grails-app/conf/Config.groovy 261 sed -i 's/\$oauthsecret\$/'$OAUTHSECRET'/gi' grails-app/conf/Config.groovy 262 fi 247 #if [ -f grails-app/conf/Searchable.groovy ]; then 248 # echo $STAMP patching searchable configuration for $TYPE instance 249 # sed -i 's/'$PROJECT'/'$PROJECT'-'$TYPE'/gi' grails-app/conf/Searchable.groovy 250 #fi 263 251 264 252 # build new war 265 253 PWD=$(pwd) 266 254 echo $STAMP current workdirectory: $PWD 267 echo $STAMP building new war...268 grails prodwar --non-interactive > /dev/null269 270 # undeploying gscf releases271 echo $STAMP undeploying $PROJECT-$OLD_APP_VERSION-ci272 curl --silent --user $MANAGER_USER:$MANAGER_PASSWORD --url $MANAGER_URL/ $PROJECT-$OLD_APP_VERSION-ci > /dev/null255 echo $STAMP building new $TYPE war... 256 grails -Dgrails.env=$TYPE war --non-interactive > /dev/null 257 258 # stopping old release 259 echo $STAMP stopping $PROJECT-$OLD_APP_VERSION-$TYPE 260 curl --silent --user $MANAGER_USER:$MANAGER_PASSWORD --url $MANAGER_URL/stop?path=/$PROJECT-$OLD_APP_VERSION-ci > /dev/null 273 261 sleep 5 274 262 263 # undeploying old release 264 echo $STAMP undeploying $PROJECT-$OLD_APP_VERSION-$TYPE 265 curl --silent --user $MANAGER_USER:$MANAGER_PASSWORD --url $MANAGER_URL/undeploy?path=/$PROJECT-$OLD_APP_VERSION-ci > /dev/null 266 sleep 5 267 275 268 # deploying new build 276 echo $STAMP deploying new productionWAR269 echo $STAMP deploying new $TYPE WAR 277 270 cp target/$PROJECT-$APP_VERSION.war $PATH_TOMCAT_WEBAPPS/$PROJECT-$APP_VERSION-$TYPE.war 278 271
Note: See TracChangeset
for help on using the changeset viewer.