You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ma...@apache.org on 2013/08/22 08:20:43 UTC

git commit: Added confirmation messages, fixed clean.sh and updated mb configuration in cloud-controller.xml

Updated Branches:
  refs/heads/master 5057a0c0c -> 757a6d4a8


Added confirmation messages, fixed clean.sh and updated mb configuration in cloud-controller.xml

Signed-off-by: Manula Thantriwatte <ma...@wso2.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/757a6d4a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/757a6d4a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/757a6d4a

Branch: refs/heads/master
Commit: 757a6d4a866dcec60901fb7b93c9aeb2a101508a
Parents: 5057a0c
Author: Imesh Gunaratne <im...@wso2.com>
Authored: Thu Aug 22 11:42:03 2013 +0530
Committer: Manula Thantriwatte <ma...@wso2.com>
Committed: Thu Aug 22 11:49:54 2013 +0530

----------------------------------------------------------------------
 tools/stratos-installer/clean.sh                | 72 +++++++++-----------
 .../cc/repository/conf/cloud-controller.xml     |  4 +-
 tools/stratos-installer/setup.sh                | 11 ++-
 3 files changed, 42 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/757a6d4a/tools/stratos-installer/clean.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/clean.sh b/tools/stratos-installer/clean.sh
index cd3087d..32fcd94 100755
--- a/tools/stratos-installer/clean.sh
+++ b/tools/stratos-installer/clean.sh
@@ -20,10 +20,10 @@
 #
 # ----------------------------------------------------------------------------
 #
-# This script is for cleaning the host machine where one or more of the Stratos servers are run.
-# Make sure the user is running as root.
+#  This script is for cleaning the host machine where one or more of the Stratos servers are run.
 # ----------------------------------------------------------------------------
 
+source "./conf/setup.conf"
 
 if [ "$UID" -ne "0" ]; then
 	echo ; echo "  You must be root to run $0.  (Try running 'sudo bash' first.)" ; echo 
@@ -38,19 +38,13 @@ function help {
     echo ""
 }
 
-while getopts a:b:c:d: opts
+while getopts a:b: opts
 do
   case $opts in
     a)
-        hostname=${OPTARG}
-        ;;
-    b)
-        host_user=${OPTARG}
-        ;;
-    c)
         mysql_user=${OPTARG}
         ;;
-    d)
+    b)
         mysql_pass=${OPTARG}
         ;;
     *)
@@ -63,50 +57,46 @@ done
 function helpclean {
     echo ""
     echo "usage:"
-    echo "clean.sh -a<hostname> -b<stratos username> -c<mysql username> -d<mysql password>"
+    echo "clean.sh -a<mysql username> -b<mysql password>"
     echo ""
 }
 
 function clean_validate {
-
-if [[ ( -z $hostname || -z $host_user || -z $mysql_user || -z $mysql_pass ) ]]; then
-    helpclean
-    exit 1
-fi
+    if [[ ( -z $mysql_user || -z $mysql_pass ) ]]; then
+        helpclean
+        exit 1
+    fi
+    if [ -z $stratos_path ]; then
+        echo "stratos_path is not set"
+        exit 1
+    fi
+    if [ -z $log_path ]; then
+        echo "log_path is not set"
+        exit 1
+    fi
 }
 
 clean_validate
 
-if [[ -d /home/git ]]; then
-    deluser git
-    rm -fr /home/git
+read -p "Please confirm that you want to remove stratos databases, installed content and logs [y/n] " answer
+if [[ $answer != y ]] ; then
+    exit 1
 fi
-mysql -u $mysql_user -p$mysql_pass -e "DROP DATABASE IF EXISTS stratos_foundation;"
-mysql -u $mysql_user -p$mysql_pass -e "DROP DATABASE IF EXISTS userstore;"
-#mysql -u $mysql_user -p$mysql_pass -e "DROP DATABASE IF EXISTS billing;"
 
+echo 'Stopping all java processes'
 killall java
+echo 'Waiting for applications to exit'
 sleep 15
-rm -rf $stratos_path/*
-rm -rf $log_path/*
-#rm -f /home/$host_user/.ssh/id_rsa
 
-#remove contents of upload folder
-if [[ -d /home/$host_user/upload ]]; then
-    rm -f /home/$host_user/upload/*
-fi
+echo 'Removing stratos_foundation database'
+mysql -u $mysql_user -p$mysql_pass -e "DROP DATABASE IF EXISTS stratos_foundation;"
 
-#clean /etc/hosts
-KEYWORD='git.'
-if grep -Fxq "$KEYWORD" /etc/hosts
-then
-    cat /etc/hosts | grep -v "$KEYWORD" > /tmp/hosts
-    mv /tmp/hosts /etc/hosts
-fi
+echo 'Removing userstore database'
+mysql -u $mysql_user -p$mysql_pass -e "DROP DATABASE IF EXISTS userstore;"
 
-#if grep -Fxq "$hostname" /etc/hosts
-#then
-#    cat /etc/hosts | grep -v "$hostname" > /tmp/hosts
-#    mv /tmp/hosts /etc/hosts
-#fi
+echo 'Removing stratos content'
+rm -rf $stratos_path/*
+
+echo 'Removing logs'
+rm -rf $log_path/*
 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/757a6d4a/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml b/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml
index aa89c1e..4d25e5f 100644
--- a/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml
+++ b/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml
@@ -43,8 +43,8 @@
 
     	<topologySync enable="true">
 		<!-- MB server info -->
-		<mbServerUrl>MB_HOSTNAME:MB_LISTEN_PORT</mbServerUrl>
-		<cron>1 * * * * ? *</cron>
+		<property name="mbServerUrl" value="MB_HOSTNAME:MB_LISTEN_PORT" />
+		<property name="cron" value="1 * * * * ? *" />
 	</topologySync>	
 
         <!-- Specify the properties that are common to an IaaS here. This element 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/757a6d4a/tools/stratos-installer/setup.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/setup.sh b/tools/stratos-installer/setup.sh
index f410b29..23917f9 100755
--- a/tools/stratos-installer/setup.sh
+++ b/tools/stratos-installer/setup.sh
@@ -29,7 +29,7 @@ set -e
 SLEEP=60
 
 source "./conf/setup.conf"
-export LOG=$log_path/stratos.log
+export LOG=$log_path/stratos-setup.log
 
 cc="false"
 elb="false"
@@ -119,7 +119,7 @@ function helpsetup {
 }
 
 echo "user provided in conf/setup.conf is $host_user. If you want to provide some other user name please specify it at the prompt."
-echo "If you want to continue with the $host_user just press enter to continue"
+echo "If you want to continue with $host_user just press enter to continue"
 read username
 if [[ $username != "" ]]; then
     host_user=$username
@@ -809,6 +809,13 @@ if [[ $demo = "ec2" ]]; then
     ./ec2-cartridge-setup.sh
 fi
 
+echo "Apache Stratos setup has successfully completed"
+
+read -p "Do you want to start the servers [y/n]? " answer
+if [[ $answer != y ]] ; then
+    exit 1
+fi
+
 # Starting the servers
 # ---------------------------------------------------------
 echo "Starting the servers" >> $LOG