Browse Source

update deploy/deploy_wisecloud_latest.sh

krrish 7 years ago
parent
commit
79bd4f5fe4
1 changed files with 15 additions and 17 deletions
  1. 15 17
      deploy/deploy_wisecloud_latest.sh

+ 15 - 17
deploy/deploy_wisecloud_latest.sh

@@ -64,7 +64,7 @@ else
 fi
 
 ENV=`echo $* | xargs -n 1 | grep "\-env" | awk -F"=" '{print $2}' | tr ',' ' '`
-echo "deploy to env=$ENV"
+echo "Start to deploy to env=$ENV"
 
 if [ "$ENV" == "cs" ]; then
     RANCHER_ACCESS_KEY=344E9FA150DD81B6F254
@@ -89,19 +89,12 @@ else
     exit 1
 fi
 
-redis_password=123456
-redis_port=7000
-postgres_user=postgres_user
-postgres_password=postgres_password
-pgdata="/var/lib/postgresql/data/pgdata"
-
-export RANCHER_URL  RANCHER_ACCESS_KEY  RANCHER_SECRET_KEY \
-        redis_password REDIS_PORT postgres_user postgres_password pgdata
+export RANCHER_URL  RANCHER_ACCESS_KEY  RANCHER_SECRET_KEY
 
 
 # get the laste redis docker-compose & rancher-compose
 for module in $APP; do
-    echo -e "\nCurrent: $module"
+    echo -e "\nCurrent module: $module"
 
     # if has another process
     retry=100
@@ -162,7 +155,7 @@ for module in $APP; do
         else
             answer_exists=false
             echo "#####################################"
-            echo "you define questions in docker-compose.yml"
+            echo "you define questions in rancher-compose.yml"
             echo "but there is no answer.txt in the compose directory, exit!"
             echo "#####################################"
             exit 2
@@ -177,15 +170,17 @@ for module in $APP; do
         sleep 1
         rancher-compose -p ${module} $ENV_ARGS rm -f
         sleep 1
-	rancher-compose -p ${module} $ENV_ARGS rm -f 2>/dev/null
-	sleep 5
-	echo "remove complete"
+        
+        # try again
+        rancher-compose -p ${module} $ENV_ARGS rm -f 2>/dev/null
+        sleep 3
+        echo "remove complete"
     fi
 
-    # compose upgrade
+    # compose upgrade or create
     echo
     if echo "$*" | grep -q "\-upgrade"; then
-        echo "creating & upgrade $module..."
+        echo "Creating & upgrade $module..."
         sleep 1
         # TODO
         if ! rancher-compose -p ${module} $ENV_ARGS upgrade <old_service> <new_service>; then 
@@ -195,13 +190,16 @@ for module in $APP; do
             exit 3
         fi
     else
-        echo "creating & up $module..."
+        echo "Creating & up $module..."
         sleep 1
         if ! rancher-compose -p ${module} $ENV_ARGS up -d; then
             echo "#####################################"
             echo "rancher-compose -p ${module} up -d failed, exit!"
             echo "#####################################"
             exit 5
+        else
+            echo "start successful"
+            echo
         fi
     fi