Fixing few usability issues with setting up Stratos - https://issues.apache.org/jira/browse/STRATOS-612
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/54793eaa Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/54793eaa Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/54793eaa Branch: refs/heads/master Commit: 54793eaa5762017f788bbecea160065f84bc0cd4 Parents: 2939931 Author: Nirmal Fernando <[email protected]> Authored: Tue Apr 15 05:16:48 2014 +0530 Committer: Nirmal Fernando <[email protected]> Committed: Tue Apr 15 05:16:48 2014 +0530 ---------------------------------------------------------------------- tools/stratos-installer/conf/setup.conf | 2 ++ tools/stratos-installer/ec2.sh | 2 ++ tools/stratos-installer/openstack.sh | 2 ++ tools/stratos-installer/setup.sh | 38 ++++++++++++++++++++++----- tools/stratos-installer/start-servers.sh | 2 ++ tools/stratos-installer/vcloud.sh | 2 ++ 6 files changed, 41 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/54793eaa/tools/stratos-installer/conf/setup.conf ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/conf/setup.conf b/tools/stratos-installer/conf/setup.conf index 2abcb3e..33a3ca0 100644 --- a/tools/stratos-installer/conf/setup.conf +++ b/tools/stratos-installer/conf/setup.conf @@ -60,6 +60,8 @@ export stratos_pack_zip=$stratos_packs/"apache-stratos-4.0.0-SNAPSHOT.zip" export activemq_pack=$stratos_packs/"apache-activemq-5.8.0-bin.tar.gz" export activemq_path=$stratos_path/"apache-activemq-5.8.0" +export jndi_template_path=$setup_path/"config/all/repository/conf/activemq/jndi.properties" + export resource_path=$setup_path/resources http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/54793eaa/tools/stratos-installer/ec2.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/ec2.sh b/tools/stratos-installer/ec2.sh index 21d47a3..adcbd78 100755 --- a/tools/stratos-installer/ec2.sh +++ b/tools/stratos-installer/ec2.sh @@ -31,6 +31,8 @@ export LOG=$log_path/stratos-ec2.log source "./conf/setup.conf" +stratos_extract_path=$1 + if [[ ! -d $log_path ]]; then mkdir -p $log_path fi http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/54793eaa/tools/stratos-installer/openstack.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/openstack.sh b/tools/stratos-installer/openstack.sh index e774468..dae8689 100755 --- a/tools/stratos-installer/openstack.sh +++ b/tools/stratos-installer/openstack.sh @@ -31,6 +31,8 @@ export LOG=$log_path/stratos-openstack.log source "./conf/setup.conf" +stratos_extract_path=$1 + if [[ ! -d $log_path ]]; then mkdir -p $log_path fi http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/54793eaa/tools/stratos-installer/setup.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/setup.sh b/tools/stratos-installer/setup.sh index 4f551a8..2678df3 100755 --- a/tools/stratos-installer/setup.sh +++ b/tools/stratos-installer/setup.sh @@ -31,12 +31,13 @@ export LOG=$log_path/stratos-setup.log profile="default" config_mb="true" +mb_client_lib_path="" auto_start_servers="false" function help { echo "" echo "Usage:" - echo "setup.sh -p \"<profile>\" [-s]" + echo "setup.sh -p \"<profile>\" [-s] [-o <port offset>]" echo "profile: [default, cc, as, sm]" echo "Example:" echo "sudo ./setup.sh -p \"default\"" @@ -45,6 +46,7 @@ function help { echo "-p: <profile> Apache Stratos product profile to be installed on this node. Provide the name of profile." echo " The available profiles are cc, as, sm or default. 'default' means you need all features will be available" echo "-s: Silent mode - No prompts and start servers after installation." + echo "-o: Port offset - Enables you to specify a port offset to the server to be started." echo "" } @@ -110,13 +112,29 @@ function general_conf_validate() { config_mb="false" fi fi + + copy_mb_client_libs fi + +} + +# Copy MB client libs +function copy_mb_client_libs() { + + read -p "Please enter the path to MB Client libs (If you need them to be copied): " answer + + mb_client_lib_path=$answer } # Setup General function general_setup() { - cp -f ./config/all/repository/conf/activemq/jndi.properties $stratos_extract_path/repository/conf/ + cp -f $jndi_template_path $stratos_extract_path/repository/conf/ + + if [[ -d $mb_client_lib_path ]]; then + cp -R $mb_client_lib_path/* $stratos_extract_path/repository/components/lib + echo "Successfully copied all the MB client libs." + fi pushd $stratos_extract_path echo "In repository/conf/carbon.xml" @@ -198,13 +216,13 @@ function cc_setup() { export cc_path=$stratos_extract_path echo "In repository/conf/cloud-controller.xml" if [[ $ec2_provider_enabled = true ]]; then - ./ec2.sh + ./ec2.sh $stratos_extract_path fi if [[ $openstack_provider_enabled = true ]]; then - ./openstack.sh + ./openstack.sh $stratos_extract_path fi if [[ $vcloud_provider_enabled = true ]]; then - ./vcloud.sh + ./vcloud.sh $stratos_extract_path fi pushd $stratos_extract_path @@ -414,7 +432,7 @@ function cep_setup() { # Execution # ------------------------------------------------ -while getopts p:s opts +while getopts ":p:o:s" opts do case $opts in p) @@ -423,6 +441,10 @@ do s) auto_start_servers="true" ;; + o) + offset=${OPTARG} + echo "You have set port offset to ${offset}" + ;; \?) help exit 1 @@ -433,7 +455,7 @@ done profile_list=`echo $profile_list | sed 's/^ *//g' | sed 's/ *$//g'` if [[ !(-z $profile_list || $profile_list = "") ]]; then arr=$(echo $profile_list | tr " " "\n") -echo $arr + for x in $arr do if [[ $x = "default" ]]; then @@ -454,6 +476,8 @@ else echo "You have not provided a profile : default profile will be selected." fi +stratos_extract_path=$stratos_extract_path"-"$profile + if [[ $host_user == "" ]]; then echo "user provided in conf/setup.conf is null. Please provide a user" http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/54793eaa/tools/stratos-installer/start-servers.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/start-servers.sh b/tools/stratos-installer/start-servers.sh index 43f8382..b709abf 100755 --- a/tools/stratos-installer/start-servers.sh +++ b/tools/stratos-installer/start-servers.sh @@ -77,6 +77,8 @@ do fi done +stratos_extract_path=$stratos_extract_path"-"$profile + if [[ $profile = "default" ]]; then echo "Starting ActiveMQ server ..." >> $LOG $activemq_path/bin/activemq start http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/54793eaa/tools/stratos-installer/vcloud.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/vcloud.sh b/tools/stratos-installer/vcloud.sh index 02a2e0e..22a5761 100755 --- a/tools/stratos-installer/vcloud.sh +++ b/tools/stratos-installer/vcloud.sh @@ -31,6 +31,8 @@ export LOG=$log_path/stratos-vcloud.log source "./conf/setup.conf" +stratos_extract_path=$1 + if [[ ! -d $log_path ]]; then mkdir -p $log_path fi
