From 87ecf94971a202b6273e9e14acc64c6d6dbd2d22 Mon Sep 17 00:00:00 2001 From: lucio Date: Thu, 9 Apr 2020 11:20:01 +0200 Subject: [PATCH] script modified --- distro/contents/install | 4 ++-- distro/contents/scripts/clean-app-state | 2 +- distro/contents/scripts/clean-container-state | 9 +++++---- distro/contents/scripts/load-env | 18 +++++++++++++----- pom.xml | 2 +- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/distro/contents/install b/distro/contents/install index 3f959e0..e1050a1 100755 --- a/distro/contents/install +++ b/distro/contents/install @@ -160,8 +160,8 @@ echo -e "\ninstalling components \c" for f in $distrolibs/*.*; do if [ -z "$dryrun" ]; then - cp $f $shared/ - basename $f >> $shared/$liblist + cp $f $shared/ + basename $f | sed -r 's/[0-9]{1,2}.[0-9]{1,2}(.[0-9]{1,2})?(-SNAPSHOT)?(-[0-9]{1,2}.[0-9]{1,2}(.[0-9]{1,2})?-[0-9]{4,8})?/*/' >> $shared/$liblist fi echo -n "." sleep .01 diff --git a/distro/contents/scripts/clean-app-state b/distro/contents/scripts/clean-app-state index a0dfeef..fcc1b85 100644 --- a/distro/contents/scripts/clean-app-state +++ b/distro/contents/scripts/clean-app-state @@ -47,7 +47,7 @@ fi echo -e "\nRemoving resource profiles from the Information System\n" -source ./load-env +source ./load-env $ghnhome #java org.gcube.smartgears.utils.sweeper.AppSweeperClient $apps 1>/dev/null #if [ "$?" != "0" ]; then diff --git a/distro/contents/scripts/clean-container-state b/distro/contents/scripts/clean-container-state index 876062f..da6d4ec 100644 --- a/distro/contents/scripts/clean-container-state +++ b/distro/contents/scripts/clean-container-state @@ -38,15 +38,15 @@ fi echo -e "\nRemoving resource profiles from the Information System\n" -source "$ghnhome"/scripts/load-env +source "$ghnhome"/scripts/load-env "$ghnhome" RETVAL= if [ -z "$filename" ]; then - java org.gcube.smartgears.utils.sweeper.ContainerSweeperClient 1>/dev/null + java org.gcube.smartgears.utils.sweeper.ContainerSweeperClient -G"$ghnhome" 1>/home/gcube/SmartGears/containerState.log RETVAL=$? else - java org.gcube.smartgears.utils.sweeper.ContainerSweeperClient $filename 1>/dev/null + java org.gcube.smartgears.utils.sweeper.ContainerSweeperClient $filename -G"$ghnhome" 1>/home/gcube/SmartGears/containerState.log RETVAL=$? if [ $RETVAL -eq 0 ] ; then echo -e "\nvolatile state saved in $ghnhome/$filename" @@ -63,4 +63,5 @@ else rm -rf $ghnhome/state fi -exit $RETVAL \ No newline at end of file +exit $RETVAL + diff --git a/distro/contents/scripts/load-env b/distro/contents/scripts/load-env index 94a8472..124de09 100644 --- a/distro/contents/scripts/load-env +++ b/distro/contents/scripts/load-env @@ -1,7 +1,15 @@ -if [ -z "$GHN_HOME" ]; then - echo -e "\nERROR:please specify the GHN_HOME env var." >&2 - echo -e "\naborting.\n" - exit 1 +ghnhome=$1 + +if [ -z "$ghnhome" ]; then + if [ -z "$GHN_HOME" ]; then + echo -e "\nERROR:please specify the gHN directory (-g) or define the GHN_HOME env var." >&2 + showhelp + echo -e "\naborting.\n" + exit 1 + else + ghnhome=$GHN_HOME + fi fi -export CLASSPATH=$CLASSPATH:"$GHN_HOME/lib/*" \ No newline at end of file + +export CLASSPATH=$CLASSPATH:"$ghnhome/lib/*" \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4cf982f..df8331e 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.gcube.distribution smartgears-distribution - 2.5.0 + 2.5.2-SNAPSHOT pom A distribution for the SmartGears Framework