Permalink
Browse files

Merge pull request #678 from ctweney/clc-1220-initd-qa

CLC-1220 Thrashing out startup and deploy scripts
  • Loading branch information...
2 parents 2b95f65 + 8afe03a commit d2fae09b9f321108ab39ed940ae8917fd22eae9e @yuhunglin yuhunglin committed Feb 15, 2013
Showing with 22 additions and 28 deletions.
  1. +2 −2 config/deploy.rb
  2. +3 −2 script/downgrade.sh
  3. +0 −23 script/init.d/calcentral
  4. +2 −1 script/start-trinidad.sh
  5. +15 −0 script/upgrade.sh
View
@@ -22,7 +22,7 @@
task :update, :roles => :calcentral_dev_host do
# Take everything offline first.
script_folder = project_root + ("/script")
- run "cd #{script_folder}; ./stop-trinidad.sh"
+ run "cd #{script_folder}; ./init.d/calcentral stop"
# Run db migrate on the first app server
servers = find_servers_for_task(current_task)
run "cd #{script_folder}; ./update-build.sh"
@@ -35,7 +35,7 @@
end
end
servers.each do |server|
- run "cd #{script_folder}; ./start-trinidad.sh", :hosts => server
+ run "cd #{script_folder}; ./init.d/calcentral start", :hosts => server
end
end
end
View
@@ -12,5 +12,6 @@ echo | $LOGIT
echo "------------------------------------------" | $LOGIT
echo "`date`: Downgrading CalCentral to $LAST_VERSION on app node: `hostname -s`" | $LOGIT
-cd script
-./migrate.sh $LAST_VERSION
+./script/init.d/calcentral stop
+
+./script/migrate.sh $LAST_VERSION
@@ -11,8 +11,6 @@ START_SCRIPT="$CC_BASE/script/start-trinidad.sh"
STOP_SCRIPT="$CC_BASE/script/stop-trinidad.sh"
BG_START_SCRIPT="$CC_BASE/script/start-backstage.sh"
BG_STOP_SCRIPT="$CC_BASE/script/stop-backstage.sh"
-UPDATE_SCRIPT="$CC_BASE/script/update-build.sh"
-MIGRATE_SCRIPT="$CC_BASE/script/migrate.sh"
DOCROOT="/var/www/html/calcentral"
OFFLINE_FILE="$DOCROOT/calcentral-in-maintenance"
NIGHTLY_HTML="$DOCROOT/index_nightly.html"
@@ -65,24 +63,6 @@ emergency () {
offline
}
-upgrade () {
- if [ ! -x "$UPDATE_SCRIPT" ]; then
- echo "$UPDATE_SCRIPT doesn't exist or is not executable"
- exit 1
- fi
- echo "Updating CalCentral code to current version on $REMOTE:$BRANCH"
- $UPDATE_SCRIPT
- if [ "X$NODEONE" != "X" ]; then
- if [ ! -x "$MIGRATE_SCRIPT" ]; then
- echo "$MIGRATE_SCRIPT doesn't exist or is not executable"
- exit 1
- fi
- echo "Migrating database..."
- $MIGRATE_SCRIPT
- start
- fi
-}
-
start() {
if [ "X$NODEONE" != "X" ]; then
if [ ! -x "$BG_START_SCRIPT" ]; then
@@ -157,9 +137,6 @@ case "$1" in
emergency)
emergency
;;
- upgrade)
- upgrade
- ;;
*)
echo "Usage: $0 {start|stop|restart|status|online|offline|nightly|maint|emergency}"
esac
@@ -34,4 +34,5 @@ sleep 30
sleep 30
# now tickle the app to warm it up
-curl -i -stderr /dev/null http://localhost:3000/ > /dev/null
+wget --recursive --delete-after --quiet http://localhost:3000/
+rm -rf localhost\:3000
View
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Script to upgrade a shared deployment of CalCentral, include code update, build, db migration, and restart.
+
+cd $( dirname "${BASH_SOURCE[0]}" )/..
+
+HOSTNAME=`uname -n`
+if [[ "${HOSTNAME}" = ets-calcentral-*-01\.ist.berkeley.edu ]]; then
+ NODEONE="yes"
+fi
+
+./script/update-build.sh
+
+if [ "X$NODEONE" != "X" ]; then
+ ./script/migrate.sh
+fi

0 comments on commit d2fae09

Please sign in to comment.