From eedf8004542ea06f846ea6950951201c347f0437 Mon Sep 17 00:00:00 2001 From: Andrea Manzi Date: Thu, 27 Mar 2014 06:32:46 +0000 Subject: [PATCH] added new common-smartgears util and added IS sweeping on the cleaning-state scripts git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/distributions/smartgears-distribution@93608 82a268e6-3cf1-43bd-a215-b396298e98cf --- distro/contents/scripts/clean-app-state | 13 +++++++++++++ distro/contents/scripts/clean-container-state | 12 ++++++++++++ distro/contents/scripts/load-env | 7 +++++++ pom.xml | 12 +++++++++--- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 distro/contents/scripts/load-env diff --git a/distro/contents/scripts/clean-app-state b/distro/contents/scripts/clean-app-state index 25f29c1..5717376 100644 --- a/distro/contents/scripts/clean-app-state +++ b/distro/contents/scripts/clean-app-state @@ -45,6 +45,19 @@ if [ ! -d "$ghnhome/state/$apps" ]; then exit 1; fi +echo -e "\nRemoving resource profiles from the Information System\n" + +source ./load-env +java org.gcube.smartgears.utils.sweeper.AppSweeperClient $apps 1>/dev/null + +if [ "$?" != "0" ]; then + echo -e "\nCould no correctly sweep the profiles from the Information System" + echo -e "\nIn case of production deployment please contact the production admin" + echo -e "\nIn case of dev deployment you can remove the state by hand by removing the $GHN_HOME/state/$apps folder" + exit 1 +fi + + echo "Removing application state $ghnhome/state/$apps" #removing folder rm -rf $ghnhome/state/$apps \ No newline at end of file diff --git a/distro/contents/scripts/clean-container-state b/distro/contents/scripts/clean-container-state index 3622f02..3f71e91 100644 --- a/distro/contents/scripts/clean-container-state +++ b/distro/contents/scripts/clean-container-state @@ -31,6 +31,18 @@ if [ -z "$ghnhome" ]; then fi fi +echo -e "\nRemoving resource profiles from the Information System\n" + +source ./load-env +java org.gcube.smartgears.utils.sweeper.ContainerSweeperClient 1>/dev/null + +if [ "$?" != "0" ]; then + echo -e "\nCould no correctly sweep the profiles from the Information System" + echo -e "\nIn case of production deployment please contact the production admin" + echo -e "\nIn case of dev deployment you can remove the state by hand by removing the $GHN_HOME/state folder" + exit 1 +fi + echo "Removing container state $ghnhome" #removing folder rm -rf $ghnhome/state \ No newline at end of file diff --git a/distro/contents/scripts/load-env b/distro/contents/scripts/load-env new file mode 100644 index 0000000..05c8dd9 --- /dev/null +++ b/distro/contents/scripts/load-env @@ -0,0 +1,7 @@ +if [ -z "$CATALINA_HOME" ]; then + echo -e "\nERROR:please specify the CATALINA_HOME env var." >&2 + echo -e "\naborting.\n" + exit 1 +fi + +export CLASSPATH="$CATALINA_HOME/lib/*" \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8b0c9b0..dff3c65 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.gcube.distribution smartgears-distribution - 1.1.0-SNAPSHOT + 1.2.0-SNAPSHOT pom A distribution for the SmartGears Framework @@ -43,16 +43,22 @@ org.gcube.core common-smartgears - [1.0.0-SNAPSHOT,) + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) probe war org.gcube.resourcemanagement whn-manager - [1.0.0-SNAPSHOT,) + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) war + + org.gcube.core + common-smartgears-utils + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) + provided +