From b1a5397ebda17b28a6613eddf00248fb5aca6d7f Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 11 Mar 2015 12:09:18 +0000 Subject: [PATCH] Creating pom to autobuild bundle. Refs #3280 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/distributions/smartgears-distribution-bundle@113562 82a268e6-3cf1-43bd-a215-b396298e98cf --- src/resources/setup.sh | 72 +++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/src/resources/setup.sh b/src/resources/setup.sh index 07994e3..a6dc041 100644 --- a/src/resources/setup.sh +++ b/src/resources/setup.sh @@ -1,4 +1,3 @@ -#!/bin/bash TOMCAT_DST_FOLDER="tomcat" TOMCAT_VERSION="${tomcat.version}" TOMCAT_PID_FILENAME="pid.txt" @@ -16,23 +15,16 @@ export CATALINA_HOME=${SMARTGEAR_ROOT}/${TOMCAT_DST_FOLDER}" function showhelp { - echo -e "\nUsage: setup.sh [-d ] [-f |-h] \n" - echo " = the directory where installing SmartGear" - echo " By default, this is the directory of this script." + echo -e "\nUsage: setup.sh [-f |-h] \n" echo " f = Really run the setup. By default it will be a dry-run" echo -e " h = shows this help.\n" } while getopts ":d:fh" opt; do case $opt in - d) distro=$OPTARG;; f) force="true";; - h) showhelp + h) showhelp;; exit 0 ;; - :) echo -e "\nERROR:option -$OPTARG requires an argument." >&2 ; - showhelp; - echo -e "\naborting.\n" - exit 1;; \?) echo -e "\nERROR:invalid option: -$OPTARG"; showhelp; echo -e "\naborting.\n" @@ -40,28 +32,50 @@ exit 0 ;; esac done - -echo "Creating tomcat symlink..." -ln -s apache-tomcat-${TOMCAT_VERSION} ${TOMCAT_DST_FOLDER} -ls -l ${TOMCAT_DST_FOLDER} - echo "" -echo "Adding the following variables to environment..." -echo "${ENV_VARIABLES}" -echo "${ENV_VARIABLES}" >> pippo.txt -#echo ${ENV_VARIABLES} >> ~/.bashrc -#source ~/.bashrc +if [-z "$force"]; then + echo "Creating tomcat symlink..." + ln -s apache-tomcat-${TOMCAT_VERSION} ${TOMCAT_DST_FOLDER} + echo "Created" + ls -l ${TOMCAT_DST_FOLDER} -echo "" -echo "Entering on SmartGear Distribution Directory " ${SMARTGEAR_DISTRIBUTION_DIRECTORY} -cd ${SMARTGEAR_DISTRIBUTION_DIRECTORY} + echo "Adding the following variables to environment..." + echo "${ENV_VARIABLES}" + echo ${ENV_VARIABLES} >> ~/.bashrc + echo "Loading new environment" + source ~/.bashrc + + echo "" + echo "Entering on SmartGear Distribution Directory " ${SMARTGEAR_DISTRIBUTION_DIRECTORY} + cd ${SMARTGEAR_DISTRIBUTION_DIRECTORY} + + echo "" + echo "Launching SmartGear install for Tomcat...." + ./install -s tomcat + + echo "" + echo "Just few steps to do to reach the goal:" +else + echo "Create tomcat symlink with the following command" + echo "ln -s apache-tomcat-${TOMCAT_VERSION} ${TOMCAT_DST_FOLDER}" + + echo "" + echo "Add the following variables to your ~/.bashrc" + echo "${ENV_VARIABLES}" + + echo "" + echo "Enter on SmartGear Distribution Directory " ${SMARTGEAR_DISTRIBUTION_DIRECTORY} + echo "cd ${SMARTGEAR_DISTRIBUTION_DIRECTORY}" + + echo "" + echo "Launch SmartGear install for Tomcat...." + echo "./install -s tomcat" + + echo "" + echo "Then:" + +fi -echo "" -echo "Launching SmartGear install for Tomcat...." -#./install -s tomcat - -echo "" -echo "Just few steps to do to reach the goal:" echo "- Modify ${CONTAINER_XML} with your hostname" echo "- Modify ${CONTAINER_XML} startup infrastructure and vres"