Changeset 1113


Ignore:
Timestamp:
Nov 10, 2010, 10:33:49 AM (10 years ago)
Author:
work@…
Message:

some fixes / improvements in the deploy script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/scripts/deploy.sh

    r1105 r1113  
    9090SVN=`which svn`
    9191DEV_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=
     93MANAGER_URL=http://$TYPE.manager.nmcdsp.org/manager/html
    9394MANAGER_USER=ci
    9495MANAGER_PASSWORD=berterni3
    95 # Keys registered by t.w.abma[at]umcutrecht address (gscf.nmcdsp.org)
    96 OAUTHKEY=Xhu1RtLtB43yIy29EYw
    97 OAUTHSECRET=gYO5ps6JLDMEdJLOQkSBoTTbq11s8CrORqvrBkc6k
    98 
    99 # Keys registered by t.w.abma[at]gmail address (gscf.nmcdsp.org)
    100 #OAUTHKEY=M07bnXDthzcbWD7KKSlDYw
    101 #OAUTHSECRET=odfnT08AUBYhh2z0PVMS9JT11D2jASwGNzAj9YFk7s
    10296
    10397# are we user tomcat?
     
    124118#SVN_REVISION=`$SVN update .| sed -n 's/At revision \(.*\)\./\1/p'`
    125119SVN_REVISION=`$SVN update|sed -n 's/At revision \(.*\)\./\1/p'`
     120SVN_REVISION=`$SVN update|sed -n 's/At revision \(.*\)\./\1/p'`
    126121RUNNING_REVISION=`cat $TEMP/$PROJECT-$TYPE.revision`
    127122
     
    131126        # builds to stop building because they have
    132127        # the same revision...
     128        echo $STAMP setting internal old revision to 0 so that deployment will always happen...
    133129        RUNNING_REVISION=0
    134130fi
     
    235231echo $STAMP setting build information variables in application.properties
    236232TIMESTAMP=`date +'%s'`
    237 sed -i 's/app\.build\.type=\w\+/app.build.type=$TYPE/gi' application.properties
     233sed -i 's/app\.build\.type=\w\+/app.build.type='$TYPE'/gi' application.properties
    238234sed -i 's/app\.build\.timestamp=\w\+/app.build.timestamp='$TIMESTAMP'/gi' application.properties
    239235sed -i 's/app\.build\.svn\.revision=\w\+/app.build.svn.revision='$SVN_REVISION'/gi' application.properties
     
    245241
    246242# patch datasource.groovy
    247 echo $STAMP patching datasource for $TYPE instance
    248 sed -i 's/5432\/'$PROJECT'/5432\/'$PROJECT'-$TYPE/g' grails-app/conf/DataSource.groovy
     243#echo $STAMP patching datasource for $TYPE instance
     244#sed -i 's/5432\/'$PROJECT'/5432\/'$PROJECT'-'$TYPE'/g' grails-app/conf/DataSource.groovy
    249245
    250246# 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
    263251
    264252# build new war
    265253PWD=$(pwd)
    266254echo $STAMP current workdirectory: $PWD
    267 echo $STAMP building new war...
    268 grails prod war --non-interactive > /dev/null
    269 
    270 # undeploying gscf releases
    271 echo $STAMP undeploying $PROJECT-$OLD_APP_VERSION-ci
    272 curl --silent --user $MANAGER_USER:$MANAGER_PASSWORD --url $MANAGER_URL/$PROJECT-$OLD_APP_VERSION-ci > /dev/null
     255echo $STAMP building new $TYPE war...
     256grails -Dgrails.env=$TYPE war --non-interactive > /dev/null
     257
     258# stopping old release
     259echo $STAMP stopping $PROJECT-$OLD_APP_VERSION-$TYPE
     260curl --silent --user $MANAGER_USER:$MANAGER_PASSWORD --url $MANAGER_URL/stop?path=/$PROJECT-$OLD_APP_VERSION-ci > /dev/null
    273261sleep 5
    274262
     263# undeploying old release
     264echo $STAMP undeploying $PROJECT-$OLD_APP_VERSION-$TYPE
     265curl --silent --user $MANAGER_USER:$MANAGER_PASSWORD --url $MANAGER_URL/undeploy?path=/$PROJECT-$OLD_APP_VERSION-ci > /dev/null
     266sleep 5
     267
    275268# deploying new build
    276 echo $STAMP deploying new production WAR
     269echo $STAMP deploying new $TYPE WAR
    277270cp target/$PROJECT-$APP_VERSION.war $PATH_TOMCAT_WEBAPPS/$PROJECT-$APP_VERSION-$TYPE.war
    278271
Note: See TracChangeset for help on using the changeset viewer.