Updated Branches:
  refs/heads/master 69bad7ce3 -> 676d64ab3

Update installer

Signed-off-by: Manula Thantriwatte <[email protected]>


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

Branch: refs/heads/master
Commit: 676d64ab35f2f59564149168574046f025900974
Parents: 69bad7c
Author: Dinesh Bandara <[email protected]>
Authored: Tue Dec 17 20:46:11 2013 +0530
Committer: Manula Thantriwatte <[email protected]>
Committed: Wed Dec 18 10:12:17 2013 +0530

----------------------------------------------------------------------
 tools/stratos-installer/clean.sh         | 27 ++++++++++-------
 tools/stratos-installer/conf/setup.conf  |  3 ++
 tools/stratos-installer/setup.sh         | 43 +++++++++++++++++++++------
 tools/stratos-installer/start-servers.sh | 11 ++++---
 4 files changed, 58 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/676d64ab/tools/stratos-installer/clean.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/clean.sh b/tools/stratos-installer/clean.sh
index be57522..f00014b 100755
--- a/tools/stratos-installer/clean.sh
+++ b/tools/stratos-installer/clean.sh
@@ -99,24 +99,29 @@ if [[ -d $stratos_path/scripts ]]; then
    rm -rf $stratos_path/scripts
 fi
 
+if [[ -d $mb_path ]]; then
+   echo 'Removing MB'
+   rm -rf $mb_path
+fi
+
+if [[ -d $cep_path ]]; then
+   echo 'Removing CEP'
+   rm -rf $cep_path
+fi
+
 if [[ -d $cc_path ]]; then
    echo 'Removing CC'
    rm -rf $cc_path
 fi
 
-if [[ -d $sc_path ]]; then
-   echo 'Removing SC'
-   rm -rf $sc_path
-fi
-
-if [[ -d $elb_path ]]; then
-   echo 'Removing ELB'
-   rm -rf $elb_path
+if [[ -d $as_path ]]; then
+   echo 'Removing AS'
+   rm -rf $as_path
 fi
 
-if [[ -d $agent_path ]]; then
-   echo 'Removing Agent'
-   rm -rf $agent_path
+if [[ -d $sm_path ]]; then
+   echo 'Removing SM'
+   rm -rf $sm_path
 fi
 
 echo 'Removing logs'

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/676d64ab/tools/stratos-installer/conf/setup.conf
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/conf/setup.conf 
b/tools/stratos-installer/conf/setup.conf
index 630dec3..eb48637 100644
--- a/tools/stratos-installer/conf/setup.conf
+++ b/tools/stratos-installer/conf/setup.conf
@@ -164,7 +164,10 @@ export stratos_foundation_db_port="3306"
 export stratos_foundation_db_user="root"
 export stratos_foundation_db_pass="mysql"
 
+export sm_mb_ip=$mb_ip
+export sm_cep_ip=$cep_ip
 export sm_mb_listen_port=$((5672 + $mb_port_offset))
+export sm_cep_tcp_port=$((7611 + $cep_port_offset))
 export sm_cc_https_port=$((9443 + $cc_port_offset))
 export sm_as_https_port=$((9443 + $as_port_offset))
 export sm_https_port=$((9443 + $sm_port_offset))

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/676d64ab/tools/stratos-installer/setup.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/setup.sh b/tools/stratos-installer/setup.sh
index b1d355a..411d672 100755
--- a/tools/stratos-installer/setup.sh
+++ b/tools/stratos-installer/setup.sh
@@ -228,18 +228,18 @@ function sm_conf_validate {
        exit 1
     fi
     if [[ ! -f $mysql_connector_jar ]]; then
-        echo "Please copy the mysql connector jar into the same folder as this 
command(stratos2 release pack folder) and update conf/setup.conf file"
+        echo "Please copy the mysql connector jar into the same folder as this 
command(stratos release pack folder) and update conf/setup.conf file"
         exit 1
     fi
-    if [[ -z $cc_port_offset ]]; then
-        echo "Please specify the port offset of CC"
+    if [[ -z $cc_port_offset || -z $as_port_offset || -z $cep_port_offset ]]; 
then
+        echo "Please specify the port offset of AS and/or CC and/or CEP"
         exit 1
     fi
-    if [[ -z $sm_ip || -z $as_ip || -z $cc_ip ]]; then
-       echo "Please specify the ips of SM and/or AS and/or CC"
-       exit 1
-    elif !(valid_ip $sm_ip && valid_ip $cc_ip && valid_ip $as_ip); then 
-        echo "Please provide valid ips for SM and/or AS and/or CC"
+    if [[ -z $sm_ip || -z $as_ip || -z $cc_ip || -z $cep_ip ]]; then
+        echo "Please specify the ips of SM and/or AS and/or CC and/or CEP"
+        exit 1
+    elif !(valid_ip $sm_ip && valid_ip $cc_ip && valid_ip $as_ip && valid_ip 
$cep_ip); then
+        echo "Please provide valid ips for SM and/or AS and/or CC and/or CEP"
         exit 1
     fi
     if [[-z $cc_hostname || -z $as_hostname ]]; then
@@ -482,6 +482,9 @@ function sm_setup {
     echo "In repository/conf/cartridge-config.properties" >> $LOG
 
     cp -f repository/conf/cartridge-config.properties 
repository/conf/cartridge-config.properties.orig
+    cat repository/conf/cartridge-config.properties.orig | sed -e 
"s@SM_IP@$sm_ip@g" > repository/conf/cartridge-config.properties
+
+    cp -f repository/conf/cartridge-config.properties 
repository/conf/cartridge-config.properties.orig
     cat repository/conf/cartridge-config.properties.orig | sed -e 
"s@CC_HOSTNAME:CC_HTTPS_PORT@$cc_hostname:$sm_cc_https_port@g" > 
repository/conf/cartridge-config.properties
 
     cp -f repository/conf/cartridge-config.properties 
repository/conf/cartridge-config.properties.orig
@@ -505,6 +508,18 @@ function sm_setup {
     cp -f repository/conf/cartridge-config.properties 
repository/conf/cartridge-config.properties.orig
     cat repository/conf/cartridge-config.properties.orig | sed -e 
"s@STRATOS_FOUNDATION_DB_SCHEMA@$stratos_foundation_db_schema@g" > 
repository/conf/cartridge-config.properties
 
+    cp -f repository/conf/cartridge-config.properties 
repository/conf/cartridge-config.properties.orig
+    cat repository/conf/cartridge-config.properties.orig | sed -e 
"s@MB_IP@$sm_mb_ip@g" > repository/conf/cartridge-config.properties
+
+    cp -f repository/conf/cartridge-config.properties 
repository/conf/cartridge-config.properties.orig
+    cat repository/conf/cartridge-config.properties.orig | sed -e 
"s@MB_LISTEN_PORT@$sm_mb_listen_port@g" > 
repository/conf/cartridge-config.properties
+
+    cp -f repository/conf/cartridge-config.properties 
repository/conf/cartridge-config.properties.orig
+    cat repository/conf/cartridge-config.properties.orig | sed -e 
"s@CEP_IP@$sm_cep_ip@g" > repository/conf/cartridge-config.properties
+
+    cp -f repository/conf/cartridge-config.properties 
repository/conf/cartridge-config.properties.orig
+    cat repository/conf/cartridge-config.properties.orig | sed -e 
"s@CEP_LISTEN_PORT@$sm_cep_tcp_port@g" > 
repository/conf/cartridge-config.properties
+
     echo "In repository/conf/datasources/master-datasources.xml" >> $LOG
     cp -f repository/conf/datasources/master-datasources.xml 
repository/conf/datasources/master-datasources.xml.orig
     cat repository/conf/datasources/master-datasources.xml.orig | sed -e 
"s@USERSTORE_DB_HOSTNAME@$userstore_db_hostname@g" > 
repository/conf/datasources/master-datasources.xml
@@ -572,6 +587,16 @@ mv -f ./hosts.tmp /etc/hosts
 # ------------------------------------------------
 # Starting the servers
 # ------------------------------------------------
+echo 'Changing owner of '$stratos_path' to '$host_user:$host_user
+chown $host_user:$host_user $stratos_path -R
+
+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
+
 echo "Starting the servers" >> $LOG
 
 echo "Starting up servers. This may take time. Look at $LOG file for server 
startup details"
@@ -580,7 +605,7 @@ chown -R $host_user.$host_user $log_path
 chmod -R 777 $log_path
 
 export setup_dir=$PWD
-su - $host_user -c "source 
$setup_dir/conf/setup.conf;$setup_dir/start-servers.sh -p$product_list >> $LOG"
+su - $host_user -c "source 
$setup_dir/conf/setup.conf;$setup_dir/start-servers.sh -p\"$product_list\" >> 
$LOG"
 
 echo "Servers started. Please look at $LOG file for server startup details"
 if [[ $sm == "true" ]]; then

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/676d64ab/tools/stratos-installer/start-servers.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/start-servers.sh 
b/tools/stratos-installer/start-servers.sh
index 2921381..22aa944 100755
--- a/tools/stratos-installer/start-servers.sh
+++ b/tools/stratos-installer/start-servers.sh
@@ -136,13 +136,12 @@ if [[ $as = "true" ]]; then
 fi
 
 
-if [[ $sc = "true" ]]; then
-    
-    echo ${sc_path}
+if [[ $sm = "true" ]]; then  
+    echo ${sm_path}
 
-    echo "Starting SC server ..." >> $LOG
-    nohup ${sc_path}/bin/stratos.sh &
-    echo "SC server started" >> $LOG
+    echo "Starting SM server ..." >> $LOG
+    nohup ${sm_path}/bin/stratos.sh &
+    echo "SM server started" >> $LOG
     sleep $SLEEP
 
 fi

Reply via email to