From 3862f22ad1d17dfc452e2846c20036c0cafbd75e Mon Sep 17 00:00:00 2001 From: lucio lelii Date: Wed, 20 Apr 2022 16:29:44 +0200 Subject: [PATCH 01/19] first steps to the distro 4-0-0 --- CHANGELOG.md | 4 +++ Dockerfile | 2 +- distro/contents/install | 9 ++----- distro/contents/logback.xml | 1 - distro/contents/samplecontainer.ini | 40 +++++++++++++++++++++++++++++ distro/standalone.xml | 4 +-- pom.xml | 3 ++- 7 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 distro/contents/samplecontainer.ini diff --git a/CHANGELOG.md b/CHANGELOG.md index 709b759..096dd8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for Smartgears Distribution +## [v4.0.0-SNAPSHOT] - 2022-03-30 + +- moving to smartgears-4.0.0 + ## [v3.4.5] - 2022-03-29 - fixes issue [#23075] diff --git a/Dockerfile b/Dockerfile index 35f41ee..263e720 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ FROM tomcat:8.5.47-jdk8-openjdk ARG nexuspath ARG filename ARG version + COPY ./target/$filename.tar.gz /smartgears-distro.tar.gz WORKDIR / - RUN curl -k $nexuspath/$filename.tar.gz --output /smartgears-distro.tar.gz RUN tar zxvf /smartgears-distro.tar.gz RUN export CATALINA_HOME=/usr/local/tomcat RUN mv smartgears-distribution-$version smartgears-distribution diff --git a/distro/contents/install b/distro/contents/install index 648707c..4c8f42f 100755 --- a/distro/contents/install +++ b/distro/contents/install @@ -220,13 +220,8 @@ function change_line { function replace_property { local PROPERTY=$1 - #local OLD_LINE=$(sed -n "/${PROPERTY}/p" $ghnhome/container.xml) - local NEW_LINE=$(sed -n "/${PROPERTY}/p" $distro/container.xml) - #echo "Replacing property ${PROPERTY}:" - #echo $OLD_LINE - #echo $NEW_LINE - change_line "${PROPERTY}" "${NEW_LINE}" $ghnhome/container.xml - #echo "done." + local NEW_LINE=$(sed -n "/${PROPERTY}/p" $distro/container.ini) + change_line "${PROPERTY}" "${NEW_LINE}" $ghnhome/container.ini } echo -e "\ninstalling configuration \c" diff --git a/distro/contents/logback.xml b/distro/contents/logback.xml index d46921c..347f69b 100644 --- a/distro/contents/logback.xml +++ b/distro/contents/logback.xml @@ -1,4 +1,3 @@ - - ${distroDirectory}/contents/samplecontainer.xml - container.xml + ${distroDirectory}/contents/samplecontainer.ini + container.ini true diff --git a/pom.xml b/pom.xml index 7c1efc6..452ebbb 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.gcube.distribution smartgears-distribution - 3.4.5 + 4.0.0-SNAPSHOT pom A distribution for the SmartGears Framework @@ -40,6 +40,7 @@ org.gcube.core common-smartgears + [4.0.0-SNAPSHOT, 5.0.0-SNAPSHOT) org.gcube.core From 90dca7b0f193138e0c91d864b590dc3e3d48cbfa Mon Sep 17 00:00:00 2001 From: lucio Date: Wed, 11 May 2022 18:44:40 +0200 Subject: [PATCH 02/19] added smartgears-management app to distribution --- .project | 1 + Dockerfile | 6 +++--- pom.xml | 22 +++++++++++++--------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.project b/.project index a30e836..2ec7193 100644 --- a/.project +++ b/.project @@ -3,6 +3,7 @@ smartgears-distribution + common-service diff --git a/Dockerfile b/Dockerfile index 263e720..f5e1c7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM tomcat:8.5.47-jdk8-openjdk +FROM tomcat:9.0.48-jdk8-openjdk-buster ARG nexuspath ARG filename ARG version @@ -6,7 +6,7 @@ FROM tomcat:8.5.47-jdk8-openjdk WORKDIR / RUN tar zxvf /smartgears-distro.tar.gz RUN export CATALINA_HOME=/usr/local/tomcat + RUN ln -s /usr/local/tomcat tomcat RUN mv smartgears-distribution-$version smartgears-distribution ENV GHN_HOME=./smartgears-distribution - RUN ./smartgears-distribution/install -s tomcat - + RUN ./smartgears-distribution/install -s tomcat \ No newline at end of file diff --git a/pom.xml b/pom.xml index 452ebbb..569d13b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,5 @@ - 4.0.0 @@ -29,7 +30,7 @@ org.gcube.distribution gcube-smartgears-bom - 2.1.0 + 3.0.0-SNAPSHOT pom import @@ -40,15 +41,10 @@ org.gcube.core common-smartgears - [4.0.0-SNAPSHOT, 5.0.0-SNAPSHOT) - - - org.gcube.core - common-smartgears-utils org.gcube.common - gxHTTP + gxHTTP org.gcube.core @@ -88,7 +84,7 @@ probe war - + + + org.gcube.core + smartgears-management + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + war + @@ -161,6 +164,7 @@ + From ef3ac3784f93d861b153ed5bd4cc890130e46343 Mon Sep 17 00:00:00 2001 From: lucio Date: Mon, 23 May 2022 16:33:08 +0200 Subject: [PATCH 03/19] docker file improved with container.ini that can be changed coping it in etc dir inside the container --- Dockerfile | 7 ++++- distro/contents/samplecontainer.xml | 41 ----------------------------- pom.xml | 6 ----- startContainer.sh | 13 +++++++++ 4 files changed, 19 insertions(+), 48 deletions(-) delete mode 100644 distro/contents/samplecontainer.xml create mode 100644 startContainer.sh diff --git a/Dockerfile b/Dockerfile index f5e1c7d..d6173b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,13 @@ FROM tomcat:9.0.48-jdk8-openjdk-buster COPY ./target/$filename.tar.gz /smartgears-distro.tar.gz WORKDIR / RUN tar zxvf /smartgears-distro.tar.gz + RUN rm /smartgears-distro.tar.gz RUN export CATALINA_HOME=/usr/local/tomcat RUN ln -s /usr/local/tomcat tomcat RUN mv smartgears-distribution-$version smartgears-distribution ENV GHN_HOME=./smartgears-distribution - RUN ./smartgears-distribution/install -s tomcat \ No newline at end of file + RUN ./smartgears-distribution/install -s tomcat + COPY startContainer.sh /startContainer.sh + RUN chmod +x /startContainer.sh + ENTRYPOINT ["/startContainer.sh"] + CMD ["catalina.sh","run"] \ No newline at end of file diff --git a/distro/contents/samplecontainer.xml b/distro/contents/samplecontainer.xml deleted file mode 100644 index 0f565fb..0000000 --- a/distro/contents/samplecontainer.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - localhost - 8080 - gcube - - - - - - - - - it - rome - 41.9000 - 12.5000 - - - - - - - - - 60 - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 569d13b..f35c2b9 100644 --- a/pom.xml +++ b/pom.xml @@ -96,12 +96,6 @@ [2.0.0,3.0.0-SNAPSHOT) war --> - - org.gcube.core - smartgears-management - [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) - war - diff --git a/startContainer.sh b/startContainer.sh new file mode 100644 index 0000000..8eb2241 --- /dev/null +++ b/startContainer.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +logs=/etc/logback.xml +container=/etc/container.ini +if [ -f "$logs" ]; then + cp $logs /tomcat/lib +fi + +if [ -f "$container" ]; then + cp $container /smartgears-distribution +fi + +exec "$@" From b8ed21c71f3d80e2ad430897198fa30a842431d4 Mon Sep 17 00:00:00 2001 From: lucio Date: Fri, 10 Jun 2022 17:13:07 +0200 Subject: [PATCH 04/19] added dependencies to the legacy-is-publisher --- pom.xml | 21 +++++++++------------ startContainer.sh | 2 ++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index f35c2b9..7d01a30 100644 --- a/pom.xml +++ b/pom.xml @@ -84,18 +84,15 @@ probe war - + org.gcube.common.core + legacy-is-publisher + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + + @@ -158,7 +155,7 @@ - + diff --git a/startContainer.sh b/startContainer.sh index 8eb2241..318fc04 100644 --- a/startContainer.sh +++ b/startContainer.sh @@ -11,3 +11,5 @@ if [ -f "$container" ]; then fi exec "$@" + + From 884af7795778eaa2af198d92d65ee033f8094ca7 Mon Sep 17 00:00:00 2001 From: lucio Date: Fri, 10 Jun 2022 18:41:38 +0200 Subject: [PATCH 05/19] lecgacy is publisher connector updated --- pom.xml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 7d01a30..0f197d5 100644 --- a/pom.xml +++ b/pom.xml @@ -86,13 +86,21 @@ org.gcube.common.core - legacy-is-publisher + legacy-is-publisher-connector [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) - + + org.gcube.resourcemanagement + whn-manager + [3.0.0-SNAPSHOT,4.0.0-SNAPSHOT) + war + + + org.gcube.data.transfer + data-transfer-service + [3.0.0-SNAPSHOT,4.0.0-SNAPSHOT) + war + From 24c9cc6c0c92ab6edc6675bbe0107c668e781fe9 Mon Sep 17 00:00:00 2001 From: lucio Date: Wed, 22 Jun 2022 18:51:44 +0200 Subject: [PATCH 06/19] data transfer service removed from deistribution --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index 0f197d5..b64c0ae 100644 --- a/pom.xml +++ b/pom.xml @@ -95,12 +95,6 @@ [3.0.0-SNAPSHOT,4.0.0-SNAPSHOT) war - - org.gcube.data.transfer - data-transfer-service - [3.0.0-SNAPSHOT,4.0.0-SNAPSHOT) - war - From 43911a9da92c55c5ebc26452f3b91983f50c163f Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 5 Jul 2022 15:30:52 +0200 Subject: [PATCH 07/19] Fixed install script --- distro/contents/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distro/contents/install b/distro/contents/install index 4c8f42f..85044da 100755 --- a/distro/contents/install +++ b/distro/contents/install @@ -233,8 +233,8 @@ if [ ! -s "$ghnhome/container.xml" ]; then sleep .01 else if [ -z "$dryrun" ]; then - #echo "Creating a backup copy of $ghnhome/container.xml" - cp $ghnhome/container.xml $ghnhome/container.xml.bck + #echo "Creating a backup copy of $ghnhome/container.ini" + cp $ghnhome/container.ini $ghnhome/container.ini.bck ## Please note the ' at the end of SmartGearsDistribution property ## the ' is needed to exactly math the property otherwise also From b4d84a15d812826f73379f249bb2a161e6ab9364 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 5 Jul 2022 15:33:16 +0200 Subject: [PATCH 08/19] Fixed install script --- distro/contents/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distro/contents/install b/distro/contents/install index 85044da..3e53d41 100755 --- a/distro/contents/install +++ b/distro/contents/install @@ -225,9 +225,9 @@ function replace_property { } echo -e "\ninstalling configuration \c" -if [ ! -s "$ghnhome/container.xml" ]; then +if [ ! -s "$ghnhome/container.ini" ]; then if [ -z "$dryrun" ]; then - cp $distro/container.xml $ghnhome/ + cp $distro/container.ini $ghnhome/ fi echo -n "." sleep .01 From 6611831b5e1a814e828f58743ba0a641cf0ff2aa Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 5 Jul 2022 16:29:42 +0200 Subject: [PATCH 09/19] Added bundles versions --- distro/contents/samplecontainer.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distro/contents/samplecontainer.ini b/distro/contents/samplecontainer.ini index ca1d21f..85c6cab 100644 --- a/distro/contents/samplecontainer.ini +++ b/distro/contents/samplecontainer.ini @@ -11,8 +11,8 @@ publicationFrequencyInSeconds = 60 [properties] ; not mandatory -SmartGearsDistribution = ${SmartGearsDistribution} -SmartGearsDistributionBundle = ${SmartGearsDistributionBundle} +SmartGearsDistribution = ${project.version} +SmartGearsDistributionBundle = UnBundled [site] ; mandatory From 2fbedef6f6a304aaad5edde3ffc10a4bc0dc2e76 Mon Sep 17 00:00:00 2001 From: lucio lelii Date: Tue, 5 Jul 2022 16:55:52 +0200 Subject: [PATCH 10/19] sample container fixed --- distro/contents/samplecontainer.ini | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/distro/contents/samplecontainer.ini b/distro/contents/samplecontainer.ini index 85c6cab..116a6a8 100644 --- a/distro/contents/samplecontainer.ini +++ b/distro/contents/samplecontainer.ini @@ -1,9 +1,9 @@ [node] ; mandatory ; optional fields: mode (=online), publication-frequency-seconds (=60), authorizeChildrenContext (=false) -mode = offline -hostname = localhost -protocol= https +mode = online +hostname = dlib29.isti.cnr.it +protocol= http port = 8080 infrastructure = gcube authorizeChildrenContext = true @@ -11,12 +11,11 @@ publicationFrequencyInSeconds = 60 [properties] ; not mandatory -SmartGearsDistribution = ${project.version} +SmartGearsDistribution = 1.0.0 SmartGearsDistributionBundle = UnBundled [site] ; mandatory -; optional fields: latitude, logitude country = it location = rome @@ -26,10 +25,12 @@ location = rome ;hostname = proxy ;port = 80 + [authorization] ; mandatory -; optional fields: provider (=org.gcube.smartgears.security.DefaultAuthorizationProvider) -provider = org.gcube.smartgears.security.DefaultAuthorizationProvider +; optional fields: provider factory (=org.gcube.smartgears.security.defaults.DefaultAuthorizationProviderFactory) +factory = org.gcube.smartgears.security.defaults.DefaultAuthorizationProviderFactory +factory.endpoint = https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/token credentials.class = org.gcube.smartgears.security.SimpleCredentials credentials.clientID = testClient credentials.secret = testSecret @@ -37,4 +38,4 @@ credentials.secret = testSecret ;[persistence] ; not mandatory (default is LocalPersistence writing in the ghn home) ;class = utils.PersistenceWriterTest -;location = /tmp +;location = /tmp \ No newline at end of file From 1f893338fbf56e85de61edd6f12101550d8992b7 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 5 Jul 2022 17:19:15 +0200 Subject: [PATCH 11/19] Fixing sample container --- distro/contents/samplecontainer.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distro/contents/samplecontainer.ini b/distro/contents/samplecontainer.ini index 116a6a8..3370703 100644 --- a/distro/contents/samplecontainer.ini +++ b/distro/contents/samplecontainer.ini @@ -2,8 +2,8 @@ ; mandatory ; optional fields: mode (=online), publication-frequency-seconds (=60), authorizeChildrenContext (=false) mode = online -hostname = dlib29.isti.cnr.it -protocol= http +hostname = localhost +protocol = http port = 8080 infrastructure = gcube authorizeChildrenContext = true From 99beeb3d6f3ea9ac4eaedc50434b47a0289fc953 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 5 Jul 2022 17:19:38 +0200 Subject: [PATCH 12/19] Set to offline sample container --- distro/contents/samplecontainer.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distro/contents/samplecontainer.ini b/distro/contents/samplecontainer.ini index 3370703..d4c1047 100644 --- a/distro/contents/samplecontainer.ini +++ b/distro/contents/samplecontainer.ini @@ -1,7 +1,7 @@ [node] ; mandatory ; optional fields: mode (=online), publication-frequency-seconds (=60), authorizeChildrenContext (=false) -mode = online +mode = offline hostname = localhost protocol = http port = 8080 From 4a27523c32681c6fb1a7624d019c6467fc6cc3cc Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 5 Jul 2022 17:20:25 +0200 Subject: [PATCH 13/19] Fixed comment --- distro/contents/samplecontainer.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distro/contents/samplecontainer.ini b/distro/contents/samplecontainer.ini index d4c1047..9e92f40 100644 --- a/distro/contents/samplecontainer.ini +++ b/distro/contents/samplecontainer.ini @@ -1,6 +1,6 @@ [node] ; mandatory -; optional fields: mode (=online), publication-frequency-seconds (=60), authorizeChildrenContext (=false) +; optional fields: mode (=online), publicationFrequencyInSeconds (=60), authorizeChildrenContext (=false) mode = offline hostname = localhost protocol = http From 3b153a2716a27d30c5e2db597fc59ce04a2c8126 Mon Sep 17 00:00:00 2001 From: lucio Date: Thu, 7 Jul 2022 10:50:14 +0200 Subject: [PATCH 14/19] distribution version fixed --- distro/contents/samplecontainer.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distro/contents/samplecontainer.ini b/distro/contents/samplecontainer.ini index 9e92f40..1af6f32 100644 --- a/distro/contents/samplecontainer.ini +++ b/distro/contents/samplecontainer.ini @@ -11,7 +11,7 @@ publicationFrequencyInSeconds = 60 [properties] ; not mandatory -SmartGearsDistribution = 1.0.0 +SmartGearsDistribution = ${project.version} SmartGearsDistributionBundle = UnBundled [site] From 814f57d6b13cd3d15b02bd1b8809c74145809651 Mon Sep 17 00:00:00 2001 From: lucio Date: Thu, 7 Jul 2022 12:03:55 +0200 Subject: [PATCH 15/19] tomcat version updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d6173b3..1849533 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM tomcat:9.0.48-jdk8-openjdk-buster +FROM tomcat:9.0.64-jdk8-openjdk-buster ARG nexuspath ARG filename ARG version From c6ca91c877bef32bdffbecdd0a671abeb0aff062 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 8 Jul 2022 14:30:53 +0200 Subject: [PATCH 16/19] Fixed indentation --- distro/contents/install | 241 ++++++++++++++++++++++------------------ 1 file changed, 135 insertions(+), 106 deletions(-) diff --git a/distro/contents/install b/distro/contents/install index 3e53d41..a569c81 100755 --- a/distro/contents/install +++ b/distro/contents/install @@ -27,27 +27,29 @@ function showhelp { } while getopts ":d:s:g:a:xh" opt; do - case $opt in - d) distro=$OPTARG;; - s) shared=$OPTARG;; - g) ghnhome=$OPTARG;; - a) apps=$OPTARG;; - x) dryrun="true";; - 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"; + case $opt in + d) distro=$OPTARG;; + s) shared=$OPTARG;; + g) ghnhome=$OPTARG;; + a) apps=$OPTARG;; + x) dryrun="true";; + 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" exit 1 >&2 ;; - esac + esac done -if [ -z "$ghnhome" ]; then - if [ -z "$GHN_HOME" ]; then +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" @@ -56,31 +58,37 @@ if [ -z "$ghnhome" ]; then ghnhome=$GHN_HOME fi fi -if [ ! -d "$ghnhome" ]; then - if [ -z "$dryrun" ]; then - mkdir $ghnhome +if [ ! -d "$ghnhome" ] +then + if [ -z "$dryrun" ] + then + mkdir $ghnhome fi fi #tomcat target -if [ "$shared" = "tomcat" ]; then - if [ -z "$CATALINA_HOME" ]; then - if [ -z "$WEB_CONTAINER_HOME" ] ; then - echo -e "\nERROR: both CATALINA_HOME and WEB_CONTAINER_HOME are undefined." >&2 - showhelp - echo -e "\naborting.\n" - exit 1 - else - CATALINA_HOME=$WEB_CONTAINER_HOME - fi - fi +if [ "$shared" = "tomcat" ] +then + if [ -z "$CATALINA_HOME" ] + then + if [ -z "$WEB_CONTAINER_HOME" ] + then + echo -e "\nERROR: both CATALINA_HOME and WEB_CONTAINER_HOME are undefined." >&2 + showhelp + echo -e "\naborting.\n" + exit 1 + else + CATALINA_HOME=$WEB_CONTAINER_HOME + fi + fi shared=$CATALINA_HOME/lib apps=$CATALINA_HOME/webapps fi #shared is set -if [ -z "$shared" ]; then +if [ -z "$shared" ] +then echo -e "\nERROR: shared directory is undefined (-s)." >&2 showhelp echo -e "\naborting.\n" @@ -88,25 +96,29 @@ if [ -z "$shared" ]; then fi #shared exists and is a directory -if [ ! -d "$shared" ]; then +if [ ! -d "$shared" ] +then echo -e "\nERROR: shared folder does not exist or is not a directory, aborting." >&2 exit 1; fi #shared exists and is a directory -if [ ! -d "$apps" ]; then +if [ ! -d "$apps" ] +then echo -e "\nERROR: apps folder does not exist or is not a directory, aborting." >&2 exit 1; fi #distrolibs exists and is a directory -if [ ! -d "$distrolibs" ]; then +if [ ! -d "$distrolibs" ] +then echo -e "\nERROR: distro libs does not exist or is not a directory, aborting." exit 1; fi #distroapps exists and is a directory -if [ ! -d "$distroapps" ]; then +if [ ! -d "$distroapps" ] +then echo -e "\nERROR: distro apps does not exist or is not a directory, aborting." exit 1; fi @@ -119,102 +131,112 @@ echo -e " target app directory = $(cd $(dirname $apps); pwd)/$(basename $apps shopt -s nullglob #uninstall libraries -if [ -f $shared/$liblist ]; then +if [ -f $shared/$liblist ] +then echo -e "\nuninstalling existing libraries \c" - while read line; do - if [ -z "$dryrun" ]; then - rm $shared/$line + while read line + do + if [ -z "$dryrun" ] + then + rm $shared/$line fi - echo -n "." - sleep .01 - - done < $shared/$liblist - if [ -z "$dryrun" ]; then - rm $shared/$liblist - fi + echo -n "." + sleep .01 + done < $shared/$liblist + if [ -z "$dryrun" ] + then + rm $shared/$liblist + fi fi #uninstall apps -if [ -f $shared/$applist ]; then +if [ -f $shared/$applist ] +then echo -e "\nuninstalling existing apps \c" - while read line; do - if [ -z "$dryrun" ]; then - rm $apps/$line - folder=${line:0:-4} - if [ ! -z "$folder" ]; then - rm -rf $apps/$folder - fi + while read line + do + if [ -z "$dryrun" ] + then + rm $apps/$line + folder=${line:0:-4} + if [ ! -z "$folder" ] + then + rm -rf $apps/$folder + fi fi - echo -n "." - sleep .01 - - done < $shared/$applist - if [ -z "$dryrun" ]; then - rm $shared/$applist - fi + + echo -n "." + sleep .01 + done < $shared/$applist + if [ -z "$dryrun" ] + then + rm $shared/$applist + fi fi #install libraries echo -e "\ninstalling components \c" for f in $distrolibs/*.*; - do - if [ -z "$dryrun" ]; then - 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 - done +do + if [ -z "$dryrun" ] + then + 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 +done #install apps echo -e "\ninstalling applications \c" for f in $distroapps/*; - do - if [ -z "$dryrun" ]; then - cp $f $apps/ - basename $f >> $shared/$applist - fi - echo -n "." - sleep .01 - done +do + if [ -z "$dryrun" ] + then + cp $f $apps/ + basename $f >> $shared/$applist + fi + echo -n "." + sleep .01 +done #install scripts echo -e "\ninstalling scripts \c" -if [ ! -d "$ghnhome/scripts" ]; then - if [ -z "$dryrun" ]; then - mkdir $ghnhome/scripts +if [ ! -d "$ghnhome/scripts" ] +then + if [ -z "$dryrun" ] + then + mkdir $ghnhome/scripts fi fi for f in $distroscripts/*; - do - if [ -z "$dryrun" ]; then - cp $f $ghnhome/scripts/ - fi +do + if [ -z "$dryrun" ] + then + cp $f $ghnhome/scripts/ + fi + echo -n "." sleep .01 - done - - - - - +done #install config function escape_slashes { - sed 's/\//\\\//g' + sed 's/\//\\\//g' } function change_line { - local OLD_LINE_PATTERN=$1; shift - local NEW_LINE=$1; shift - local FILE=$1 + local OLD_LINE_PATTERN=$1; shift + local NEW_LINE=$1; shift + local FILE=$1 - local NEW=$(echo "${NEW_LINE}" | escape_slashes) - sed -i '/'"${OLD_LINE_PATTERN}"'/s/.*/'"${NEW}"'/' "${FILE}" + local NEW=$(echo "${NEW_LINE}" | escape_slashes) + sed -i '/'"${OLD_LINE_PATTERN}"'/s/.*/'"${NEW}"'/' "${FILE}" } @@ -225,12 +247,14 @@ function replace_property { } echo -e "\ninstalling configuration \c" -if [ ! -s "$ghnhome/container.ini" ]; then - if [ -z "$dryrun" ]; then +if [ ! -s "$ghnhome/container.ini" ] +then + if [ -z "$dryrun" ] + then cp $distro/container.ini $ghnhome/ fi echo -n "." - sleep .01 + sleep .01 else if [ -z "$dryrun" ]; then #echo "Creating a backup copy of $ghnhome/container.ini" @@ -244,22 +268,27 @@ else replace_property $property done fi + echo -n "." - sleep .01 + sleep .01 fi -if [ -z "$dryrun" ]; then - cat $distro/logback.xml | sed "s|\${LOGFILE}|$ghnhome|" > $shared/logback.xml - echo -n "." - sleep .01 + +if [ -z "$dryrun" ] +then + cat $distro/logback.xml | sed "s|\${LOGFILE}|$ghnhome|" > $shared/logback.xml + echo -n "." + sleep .01 fi #creating the symlink to shared and apps folder -if [ -z "$dryrun" ]; then +if [ -z "$dryrun" ] +then ln -s $shared $ghnhome/lib fi -if [ -z "$dryrun" ]; then +if [ -z "$dryrun" ] +then ln -s $apps $ghnhome/apps fi From 35ef5b7f32bf917df0d6d9a157fb931038814579 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 22 Jul 2022 15:40:08 +0200 Subject: [PATCH 17/19] Fixed CHANGELOG --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 096dd8d..b9dc2dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,19 +6,23 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - moving to smartgears-4.0.0 + ## [v3.4.5] - 2022-03-29 - fixes issue [#23075] + ## [v3.4.4] - 2022-03-23 - solved issue on policy check + ## [v3.4.3] - 2022-01-19 - enabled policy check on smartgears - container configuration for test added + ## [v3.4.2] - 2021-11-08 - common-smartgrears library updated @@ -28,22 +32,27 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Released to have and up-to-date distribution + ## [v3.4.0] - 2020-05-25 - Released to have and up-to-date distribution + ## [v3.3.0] - Accounting-lib inherited dependency has been upgraded to 4.1.0 + ## [v3.2.0] - clean-container script uses proxy + ## [v3.1.0] - Upgraded gcube-smartgears-bom to version 2.1.0 + ## [v3.0.0] - 2020-11-11 - Switched JSON management to gcube-jackson [#19283] From ca0b020813a67185c775d32678fcf788a4e32556 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 16 Nov 2022 11:41:45 +0100 Subject: [PATCH 18/19] Fixed ommon-smartgears version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b64c0ae..964a79f 100644 --- a/pom.xml +++ b/pom.xml @@ -80,14 +80,14 @@ org.gcube.core common-smartgears - [3.0.0,4.0.0-SNAPSHOT) + [4.0.0-SNAPSHOT,5.0.0-SNAPSHOT) probe war org.gcube.common.core legacy-is-publisher-connector - [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) org.gcube.resourcemanagement From c0326edbe1511ed963eb26ee168dffb2dc74ea25 Mon Sep 17 00:00:00 2001 From: lucio Date: Fri, 31 Mar 2023 14:17:34 +0200 Subject: [PATCH 19/19] dockerFile updated --- Dockerfile | 7 +++---- pom.xml | 24 ++++++++++-------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1849533..9df09ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ -FROM tomcat:9.0.64-jdk8-openjdk-buster - ARG nexuspath - ARG filename - ARG version +FROM tomcat:9.0.65-jdk11-openjdk-buster + ARG filename=smartgears-distribution-4.0.0-SNAPSHOT + ARG version=4.0.0-SNAPSHOT COPY ./target/$filename.tar.gz /smartgears-distro.tar.gz WORKDIR / RUN tar zxvf /smartgears-distro.tar.gz diff --git a/pom.xml b/pom.xml index 964a79f..b26e4c6 100644 --- a/pom.xml +++ b/pom.xml @@ -7,24 +7,20 @@ org.gcube.tools 1.1.0 - org.gcube.distribution smartgears-distribution 4.0.0-SNAPSHOT pom A distribution for the SmartGears Framework - distro https://wiki.gcube-system.org/gcube/SmartGears - scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git https://code-repo.d4science.org/gCubeSystem/${project.artifactId} - @@ -36,7 +32,6 @@ - org.gcube.core @@ -87,15 +82,19 @@ org.gcube.common.core legacy-is-publisher-connector - [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + - org.gcube.resourcemanagement - whn-manager - [3.0.0-SNAPSHOT,4.0.0-SNAPSHOT) - war + org.slf4j + slf4j-api + runtime - + + + + + + @@ -134,8 +133,6 @@ true - - @@ -157,7 +154,6 @@ -