Compare commits

...

93 Commits

Author SHA1 Message Date
Alfredo Oliviero 42c285a4c6 updated buildDistribution script 2024-05-13 12:33:33 +02:00
Lucio Lelii 56fcf28afa Merge branch 'master' of https://code-repo.d4science.org/gCubeSystem/smartgears-distribution 2024-05-08 14:49:39 +02:00
lucio 0edcfe3ad5 resource registry connector re-added 2024-05-08 14:47:09 +02:00
Alfredo Oliviero d381f2bc30 passato a versione 4.0.1 per indagare un conflitto 2024-05-07 19:01:24 +02:00
Alfredo Oliviero dcecfe224c dockerfile con versione parametrica 2024-05-07 18:20:47 +02:00
Alfredo Oliviero 9d52aef7cb aggiornato readme come da template 2024-05-07 18:20:15 +02:00
Alfredo Oliviero 6bc3bd6714 buildDistribution.sh output 2024-05-07 15:02:57 +02:00
Alfredo Oliviero abd273cc0b push on d4science harbor (hub.dev.d4science.org) 2024-05-07 14:46:13 +02:00
lucio 8b3224226e added config folder 2024-05-07 14:44:06 +02:00
lucio e185fdde66 build with different java version 2024-03-12 11:50:13 +01:00
lucio f7d4877e5c updated 2024-03-08 15:10:14 +01:00
lucio a8aa65b889 removed exec folder 2024-03-05 15:18:41 +01:00
lucio 834f30a5ad Merge branch 'master' of
https://code-repo.d4science.org/gCubeSystem/smartgears-distribution.git
2024-03-05 15:17:19 +01:00
lucio 56a49c1ec5 moved startContainer into a sub folder and created a script to build and
create the docker image
2024-03-05 15:04:31 +01:00
Alfredo Oliviero b50f991932 moved startContainer.sh to tomcat_file folder 2024-02-22 17:35:10 +01:00
lucio d621e840ba moved to maven parent 1.2.0 2024-02-22 12:04:53 +01:00
lucio d645c63d84 FROM docker image updated to jdk11-temurin-jammy 2024-02-20 17:08:32 +01:00
lucio a8a6fab7a6 solved Docker issue with CMD 2024-02-07 15:45:50 +01:00
lucio 1234c7db69 Merge branch 'master' of
https://code-repo.d4science.org/gCubeSystem/smartgears-distribution.git
2024-02-02 12:05:54 +01:00
lucio 6ea2e4696f Merge branch 'master' of https://code-repo.d4science.org/gCubeSystem/smartgears-distribution.git 2023-08-03 12:12:26 +02:00
lucio 18d1fd9370 readded whn-manager 2023-08-03 12:12:14 +02:00
luca.frosini a10604dd24 Ignored MacOs File 2023-06-21 11:47:00 +02:00
lucio 873188eac3 resource registry publisher added to distro 2023-05-09 17:17:23 +02:00
lucio 6dcb9c527f changed to include context-utils for Smartgears4 2023-05-09 17:10:43 +02:00
lucio 360ef51c6b removed old changelog 2023-04-04 11:48:59 +02:00
Lucio Lelii 650b23cfcc Merge remote-tracking branch 'origin/feature/22955' 2023-04-04 11:48:11 +02:00
lucio c0326edbe1 dockerFile updated 2023-03-31 14:17:34 +02:00
Luca Frosini 932f7d4351 Removed -SNAPSHOT to release the component 2023-03-03 12:13:14 +01:00
Luca Frosini 8b86b76926 Readded resource-registry-handlers to distribution 2023-02-24 10:36:34 +01:00
Luca Frosini 23ecfe3924 upgraded gcube-smartgears-bom 2023-02-10 16:22:51 +01:00
Luca Frosini ca0b020813 Fixed ommon-smartgears version 2022-11-16 11:41:45 +01:00
Luca Frosini 9ff239d520 Removed -SNAPSHOT to release the component 2022-11-02 16:33:07 +01:00
Luca Frosini 42f62c62df Creating version 3.4.7-SNAPSHOT 2022-11-02 16:31:51 +01:00
Luca Frosini e7a86bfad4 Removed -SNAPSHOT to release the component 2022-11-02 16:23:08 +01:00
Luca Frosini 44b0ce8473 Added resource-registry-handlers to distribution 2022-10-27 14:55:10 +02:00
Luca Frosini 51d9ae6f42 Upgraded version to include new common-smartgears version 2022-10-19 14:28:32 +02:00
Luca Frosini 35ef5b7f32 Fixed CHANGELOG 2022-07-22 15:40:08 +02:00
Luca Frosini c6ca91c877 Fixed indentation 2022-07-08 14:30:53 +02:00
Lucio Lelii 814f57d6b1 tomcat version updated 2022-07-07 12:03:55 +02:00
Lucio Lelii 3b153a2716 distribution version fixed 2022-07-07 10:50:14 +02:00
Luca Frosini 4a27523c32 Fixed comment 2022-07-05 17:20:25 +02:00
Luca Frosini 99beeb3d6f Set to offline sample container 2022-07-05 17:19:38 +02:00
Luca Frosini 1f893338fb Fixing sample container 2022-07-05 17:19:15 +02:00
Lucio Lelii 2fbedef6f6 sample container fixed 2022-07-05 16:55:52 +02:00
Luca Frosini 6611831b5e Added bundles versions 2022-07-05 16:29:42 +02:00
Luca Frosini b4d84a15d8 Fixed install script 2022-07-05 15:33:16 +02:00
Luca Frosini 43911a9da9 Fixed install script 2022-07-05 15:30:52 +02:00
Lucio Lelii 24c9cc6c0c data transfer service removed from deistribution 2022-06-22 18:51:44 +02:00
Lucio Lelii 884af77957 lecgacy is publisher connector updated 2022-06-10 18:41:38 +02:00
Lucio Lelii b8ed21c71f added dependencies to the legacy-is-publisher 2022-06-10 17:13:07 +02:00
Lucio Lelii ef3ac3784f docker file improved with container.ini that can be changed coping it in
etc dir inside the container
2022-05-23 16:33:08 +02:00
Lucio Lelii 90dca7b0f1 added smartgears-management app to distribution 2022-05-11 18:44:40 +02:00
Lucio Lelii dbeaf97783 Merge branch 'master' of https://code-repo.d4science.org/gCubeSystem/smartgears-distribution.git 2022-05-05 11:44:32 +02:00
Lucio Lelii 4beadb0ee3 commit for release 2022-04-20 16:45:18 +02:00
Lucio Lelii 3862f22ad1 first steps to the distro 4-0-0 2022-04-20 16:29:44 +02:00
Luca Frosini c22eb5364a Removed -SNAPSHOT for release 2022-03-31 10:57:54 +02:00
Luca Frosini 9b26cf27cc Recreating 3.4.5-SNAPSHOT 2022-03-31 10:56:32 +02:00
Lucio Lelii 37c896049f fixes issue [#23075] 2022-03-29 15:47:31 +02:00
Lucio Lelii 03c0d63c70 issue on policy check solved 2022-03-23 10:48:03 +01:00
Lucio Lelii 464c7e513a commit for release 2022-03-11 16:47:42 +01:00
Lucio Lelii 7e14a564ef update for smartgears changes 2022-03-04 14:53:17 +01:00
Lucio Lelii 1e25317197 Update 'CHANGELOG.md' 2021-11-09 11:06:25 +01:00
Lucio Lelii 4dd422f8a2 Update 'pom.xml' 2021-11-08 17:25:37 +01:00
Lucio Lelii 18887140a5 Update 'CHANGELOG.md' 2021-11-08 17:25:08 +01:00
Luca Frosini cf1ff69da0 Restore version 3.4.1 due to release in progress 2021-07-01 17:09:47 +02:00
Luca Frosini e0c7e7dd16 Enhanced gcube-smartgears-bom version 2021-06-30 10:39:59 +02:00
Lucio Lelii 5b43d7ebaf Aggiornare 'CHANGELOG.md' 2021-06-24 15:30:54 +02:00
Lucio Lelii ef782331b4 Aggiornare 'CHANGELOG.md' 2021-06-24 15:30:15 +02:00
Lucio Lelii a2be3ace78 Aggiornare 'pom.xml' 2021-06-24 15:29:36 +02:00
Luca Frosini 704b41038c Enhanced version 2021-06-15 16:46:30 +02:00
lucio.lelii a170003317 updated for release 2021-05-25 10:24:38 +02:00
Luca Frosini a7206d002c Removed -SNAPSHOT for release 2021-04-16 11:26:26 +02:00
Luca Frosini e86d348411 fixed typos in changelog 2021-04-16 11:24:51 +02:00
Luca Frosini fff47c511c Enhanced version for release 2021-04-16 11:22:49 +02:00
lucio.lelii 5c47523102 CRLF removed form text files 2021-03-03 18:19:45 +01:00
lucio.lelii 81a3b56306 added proxy use on clean container state 2021-02-01 11:54:49 +01:00
Luca Frosini 0abf224586 Removed -SNAPSHOT to release the component 2020-11-24 21:41:32 +01:00
Luca Frosini 3f232563c2 Upgraded gcube-smartgears-bom to 2.1.0-SNAPSHOT 2020-11-19 15:43:25 +01:00
Luca Frosini 412471a48c Fixed version on CHANGELOG 2020-10-29 18:53:41 +01:00
Luca Frosini 290d047372 Removed -SNAPSHOT from version and lower bound dependencies range to
release the component refs #19644
2020-10-29 17:24:34 +01:00
Luca Frosini df635bbec0 Readded libraries 2020-09-25 16:14:47 +02:00
Luca Frosini cff8a877f3 Removed new lib which causes container startup errors 2020-09-25 16:12:26 +02:00
Luca Frosini 67cf1488f8 Added new IS libraries 2020-09-25 14:53:31 +02:00
Luca Frosini a8d36e9346 Enhanced common-smartgears range 2020-09-25 10:53:39 +02:00
Luca Frosini 359dcd6fe4 Enhanced document-store-lib-accounting-service range 2020-09-25 10:52:51 +02:00
Luca Frosini 587b6223dd Fixed CHANGELOG 2020-08-06 16:32:52 +02:00
Luca Frosini cb33d459fe Fixed CHANGELOG according to the new template 2020-08-05 16:04:43 +02:00
Luca Frosini 2ab980c54a Fixed README.md 2020-07-17 10:30:45 +02:00
Luca Frosini dc4f6ea420 Fixed changelog 2020-07-17 10:27:51 +02:00
Luca Frosini 318a97990f Fixed changelog 2020-07-16 21:41:44 +02:00
Luca Frosini 67facfe0d1 Fixing distro files and pom according to new release procedure 2020-07-16 21:40:16 +02:00
Luca Frosini 7eb61937b0 Switching to gcube-jackson 2020-07-10 18:21:54 +02:00
Lucio Lelii 753ba12076 commit for release 4.23 2020-05-25 10:10:42 +02:00
22 changed files with 1041 additions and 327 deletions

3
.gitignore vendored
View File

@ -2,3 +2,6 @@ target
.classpath
.project
.settings
/.DS_Store
/bin/
/package-lock.json

View File

@ -3,6 +3,7 @@
<name>smartgears-distribution</name>
<comment></comment>
<projects>
<project>common-service</project>
</projects>
<buildSpec>
<buildCommand>

190
CHANGELOG.md Normal file
View File

@ -0,0 +1,190 @@
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
# Changelog for Smartgears Distribution
## [v4.0.1-SNAPSHOT] - 2022-03-30
- new version number
## [v4.0.0-SNAPSHOT] - 2022-03-30
- 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
## [v3.4.1] - 2021-06-25
- 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]
- Fixed distro files and pom according to new release procedure
## [v2.5.4] - 2020-06-19
- Released to have and up-to-date distribution
## [v2-5.3] - 2020-05-07
- Released to have and up-to-date distribution
## [v2.5.1] - 2020-03-30
- Released to have and up-to-date distribution
## [v2.5.0] - 2020-02-04
- Upgraded authorization version
## [v2.4.0] - 2019-12-19
- ...
## [v2.3.0] - 2019-11-08
- Fixed distro files and pom according to new release procedure
## [v2.2.3] - 2019-05-27
- Fixed gxHTTP dependency to allow ETICs to build the component
## [v2.2.2] - 2019-02-26
- Using gcube-bom and gcube-smartgears-bom instead of maven-smartgears-bom
- Fixed changelog
## [v2.2.0] - 2018-02-15
- Changed log level from FATAL to ERROR [#9708]
- Added document-store-lib-accounting-service in place of document-store-lib-couchbase
## [v2.1.3] - 2017-10-09
- Added logback 1.11 to support Time and Size rolling of logs
## [v2.1.2] - 2017-05-02
- common-smartgears-utils re-adedd to the distribution
## [v2.1.0] - 2017-03-16
- Fixed distro files
- Added data-transfer service as part of the distribution
## [v2.0.0] - 2016-11-07
- Added new Authorization Mechanism based on token
## [v1.2.8] - 2016-07-28
- ...
## [v1.2.7] - 2016-04-08
- ...
## [v1.2.6] - 2016-02-08
- Set default log level to WARN [#2145]
- Fixed distribution field on monitor missing when a smartgears node is upgraded [#1268]
## [v1.2.5] - 2015-12-09
- Added smartgears-distribution (this project) version on ghn profile.
- Added accounting and authorization libs
## [v1.2.4] - 2015-07-22
- Added possibility to use WEB_CONTAINER_HOME to specify the container folder. This environment variable has priority over CATALINA_HOME in the install script
## [v1.2.3] - 2015-06-18
- Stripped version from name of the included war
## [v1.2.2] - 2015-04-28
- Moved libs and war directories under target to make mvn clean properly working. The generated tar.gz remain the same
## [v1.2.1] - 2015-04-15
- smartgears-distribution-bundle version is published on ghn profile
## [v1.2.0] - 2014-04-04
- Included smartgears-utils
- Upgraded clean scripts to clean the IS
- Added symlink for shared libs
## [v1.1.0] - 2014-01-31
- JAVA 7 Release
- Included wHN manager service
## [v1.0.0] - 2013-10-24
- First Release

5
DockerInfo.txt Normal file
View File

@ -0,0 +1,5 @@
for current platform:
docker build -t smartgears-distribution:4.0.0-SNAPSHOT-java11-tomcat9 .
for multiple platforms:
docker build -t smartgears-distribution:4.0.0-SNAPSHOT-java11-tomcat9 --platform=linux/amd64,linux/arm64,linux/arm/v7 .

22
Dockerfile Normal file
View File

@ -0,0 +1,22 @@
ARG JAVA_VERSION=11
FROM tomcat:10.1.19-jdk${JAVA_VERSION}-temurin-jammy
ARG SMARTGEARS_VERSION=""
ENV FILENAME=smartgears-distribution-${SMARTGEARS_VERSION}
COPY ./target/${FILENAME}.tar.gz /smartgears-distro.tar.gz
WORKDIR /
# all file and folder in etc/config are moved to the smartgears applications configuration directory
# for specific application configuration ( configuration file for app with contextPath "contextPath" must be placed in /etc/config/contextPath)
RUN mkdir -p /etc/config
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-$SMARTGEARS_VERSION smartgears-distribution
ENV GHN_HOME=./smartgears-distribution
RUN ./smartgears-distribution/install -s tomcat
COPY tomcat_files/startContainer.sh /startContainer.sh
RUN chmod +x /startContainer.sh
ENTRYPOINT ["/startContainer.sh"]
CMD ["catalina.sh","run"]

View File

@ -0,0 +1,16 @@
FROM tomcat:10.1.19-jdk11-temurin-jammy
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
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
COPY exec/startContainer.sh /startContainer.sh
RUN chmod +x /startContainer.sh
ENTRYPOINT ["/startContainer.sh"]
CMD ["catalina.sh","run"]

26
FUNDING.md Normal file
View File

@ -0,0 +1,26 @@
# Acknowledgments
The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
- the Seventh Framework Programme for research, technological development and demonstration
- [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
- [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
- [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
- [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
- [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
- the H2020 research and innovation programme
- [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
- [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
- [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
- [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
- [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
- [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
- [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
- [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
- [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
- [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
- [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
- [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
- [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);

312
LICENSE.md Normal file
View File

@ -0,0 +1,312 @@
# European Union Public Licence V. 1.1
EUPL © the European Community 2007
This European Union Public Licence (the “EUPL”) applies to the Work or Software
(as defined below) which is provided under the terms of this Licence. Any use of
the Work, other than as authorised under this Licence is prohibited (to the
extent such use is covered by a right of the copyright holder of the Work).
The Original Work is provided under the terms of this Licence when the Licensor
(as defined below) has placed the following notice immediately following the
copyright notice for the Original Work:
Licensed under the EUPL V.1.1
or has expressed by any other mean his willingness to license under the EUPL.
## 1. Definitions
In this Licence, the following terms have the following meaning:
- The Licence: this Licence.
- The Original Work or the Software: the software distributed and/or
communicated by the Licensor under this Licence, available as Source Code and
also as Executable Code as the case may be.
- Derivative Works: the works or software that could be created by the Licensee,
based upon the Original Work or modifications thereof. This Licence does not
define the extent of modification or dependence on the Original Work required
in order to classify a work as a Derivative Work; this extent is determined by
copyright law applicable in the country mentioned in Article 15.
- The Work: the Original Work and/or its Derivative Works.
- The Source Code: the human-readable form of the Work which is the most
convenient for people to study and modify.
- The Executable Code: any code which has generally been compiled and which is
meant to be interpreted by a computer as a program.
- The Licensor: the natural or legal person that distributes and/or communicates
the Work under the Licence.
- Contributor(s): any natural or legal person who modifies the Work under the
Licence, or otherwise contributes to the creation of a Derivative Work.
- The Licensee or “You”: any natural or legal person who makes any usage of the
Software under the terms of the Licence.
- Distribution and/or Communication: any act of selling, giving, lending,
renting, distributing, communicating, transmitting, or otherwise making
available, on-line or off-line, copies of the Work or providing access to its
essential functionalities at the disposal of any other natural or legal
person.
## 2. Scope of the rights granted by the Licence
The Licensor hereby grants You a world-wide, royalty-free, non-exclusive,
sub-licensable licence to do the following, for the duration of copyright vested
in the Original Work:
- use the Work in any circumstance and for all usage, reproduce the Work, modify
- the Original Work, and make Derivative Works based upon the Work, communicate
- to the public, including the right to make available or display the Work or
- copies thereof to the public and perform publicly, as the case may be, the
- Work, distribute the Work or copies thereof, lend and rent the Work or copies
- thereof, sub-license rights in the Work or copies thereof.
Those rights can be exercised on any media, supports and formats, whether now
known or later invented, as far as the applicable law permits so.
In the countries where moral rights apply, the Licensor waives his right to
exercise his moral right to the extent allowed by law in order to make effective
the licence of the economic rights here above listed.
The Licensor grants to the Licensee royalty-free, non exclusive usage rights to
any patents held by the Licensor, to the extent necessary to make use of the
rights granted on the Work under this Licence.
## 3. Communication of the Source Code
The Licensor may provide the Work either in its Source Code form, or as
Executable Code. If the Work is provided as Executable Code, the Licensor
provides in addition a machine-readable copy of the Source Code of the Work
along with each copy of the Work that the Licensor distributes or indicates, in
a notice following the copyright notice attached to the Work, a repository where
the Source Code is easily and freely accessible for as long as the Licensor
continues to distribute and/or communicate the Work.
## 4. Limitations on copyright
Nothing in this Licence is intended to deprive the Licensee of the benefits from
any exception or limitation to the exclusive rights of the rights owners in the
Original Work or Software, of the exhaustion of those rights or of other
applicable limitations thereto.
## 5. Obligations of the Licensee
The grant of the rights mentioned above is subject to some restrictions and
obligations imposed on the Licensee. Those obligations are the following:
Attribution right: the Licensee shall keep intact all copyright, patent or
trademarks notices and all notices that refer to the Licence and to the
disclaimer of warranties. The Licensee must include a copy of such notices and a
copy of the Licence with every copy of the Work he/she distributes and/or
communicates. The Licensee must cause any Derivative Work to carry prominent
notices stating that the Work has been modified and the date of modification.
Copyleft clause: If the Licensee distributes and/or communicates copies of the
Original Works or Derivative Works based upon the Original Work, this
Distribution and/or Communication will be done under the terms of this Licence
or of a later version of this Licence unless the Original Work is expressly
distributed only under this version of the Licence. The Licensee (becoming
Licensor) cannot offer or impose any additional terms or conditions on the Work
or Derivative Work that alter or restrict the terms of the Licence.
Compatibility clause: If the Licensee Distributes and/or Communicates Derivative
Works or copies thereof based upon both the Original Work and another work
licensed under a Compatible Licence, this Distribution and/or Communication can
be done under the terms of this Compatible Licence. For the sake of this clause,
“Compatible Licence” refers to the licences listed in the appendix attached to
this Licence. Should the Licensees obligations under the Compatible Licence
conflict with his/her obligations under this Licence, the obligations of the
Compatible Licence shall prevail.
Provision of Source Code: When distributing and/or communicating copies of the
Work, the Licensee will provide a machine-readable copy of the Source Code or
indicate a repository where this Source will be easily and freely available for
as long as the Licensee continues to distribute and/or communicate the Work.
Legal Protection: This Licence does not grant permission to use the trade names,
trademarks, service marks, or names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the copyright notice.
## 6. Chain of Authorship
The original Licensor warrants that the copyright in the Original Work granted
hereunder is owned by him/her or licensed to him/her and that he/she has the
power and authority to grant the Licence.
Each Contributor warrants that the copyright in the modifications he/she brings
to the Work are owned by him/her or licensed to him/her and that he/she has the
power and authority to grant the Licence.
Each time You accept the Licence, the original Licensor and subsequent
Contributors grant You a licence to their contributions to the Work, under the
terms of this Licence.
## 7. Disclaimer of Warranty
The Work is a work in progress, which is continuously improved by numerous
contributors. It is not a finished work and may therefore contain defects or
“bugs” inherent to this type of software development.
For the above reason, the Work is provided under the Licence on an “as is” basis
and without warranties of any kind concerning the Work, including without
limitation merchantability, fitness for a particular purpose, absence of defects
or errors, accuracy, non-infringement of intellectual property rights other than
copyright as stated in Article 6 of this Licence.
This disclaimer of warranty is an essential part of the Licence and a condition
for the grant of any rights to the Work.
## 8. Disclaimer of Liability
Except in the cases of wilful misconduct or damages directly caused to natural
persons, the Licensor will in no event be liable for any direct or indirect,
material or moral, damages of any kind, arising out of the Licence or of the use
of the Work, including without limitation, damages for loss of goodwill, work
stoppage, computer failure or malfunction, loss of data or any commercial
damage, even if the Licensor has been advised of the possibility of such
damage. However, the Licensor will be liable under statutory product liability
laws as far such laws apply to the Work.
## 9. Additional agreements
While distributing the Original Work or Derivative Works, You may choose to
conclude an additional agreement to offer, and charge a fee for, acceptance of
support, warranty, indemnity, or other liability obligations and/or services
consistent with this Licence. However, in accepting such obligations, You may
act only on your own behalf and on your sole responsibility, not on behalf of
the original Licensor or any other Contributor, and only if You agree to
indemnify, defend, and hold each Contributor harmless for any liability incurred
by, or claims asserted against such Contributor by the fact You have accepted
any such warranty or additional liability.
## 10. Acceptance of the Licence
The provisions of this Licence can be accepted by clicking on an icon “I agree”
placed under the bottom of a window displaying the text of this Licence or by
affirming consent in any other similar way, in accordance with the rules of
applicable law. Clicking on that icon indicates your clear and irrevocable
acceptance of this Licence and all of its terms and conditions.
Similarly, you irrevocably accept this Licence and all of its terms and
conditions by exercising any rights granted to You by Article 2 of this Licence,
such as the use of the Work, the creation by You of a Derivative Work or the
Distribution and/or Communication by You of the Work or copies thereof.
## 11. Information to the public
In case of any Distribution and/or Communication of the Work by means of
electronic communication by You (for example, by offering to download the Work
from a remote location) the distribution channel or media (for example, a
website) must at least provide to the public the information requested by the
applicable law regarding the Licensor, the Licence and the way it may be
accessible, concluded, stored and reproduced by the Licensee.
## 12. Termination of the Licence
The Licence and the rights granted hereunder will terminate automatically upon
any breach by the Licensee of the terms of the Licence.
Such a termination will not terminate the licences of any person who has
received the Work from the Licensee under the Licence, provided such persons
remain in full compliance with the Licence.
## 13. Miscellaneous
Without prejudice of Article 9 above, the Licence represents the complete
agreement between the Parties as to the Work licensed hereunder.
If any provision of the Licence is invalid or unenforceable under applicable
law, this will not affect the validity or enforceability of the Licence as a
whole. Such provision will be construed and/or reformed so as necessary to make
it valid and enforceable.
The European Commission may publish other linguistic versions and/or new
versions of this Licence, so far this is required and reasonable, without
reducing the scope of the rights granted by the Licence. New versions of the
Licence will be published with a unique version number.
All linguistic versions of this Licence, approved by the European Commission,
have identical value. Parties can take advantage of the linguistic version of
their choice.
## 14. Jurisdiction
Any litigation resulting from the interpretation of this License, arising
between the European Commission, as a Licensor, and any Licensee, will be
subject to the jurisdiction of the Court of Justice of the European Communities,
as laid down in article 238 of the Treaty establishing the European Community.
Any litigation arising between Parties, other than the European Commission, and
resulting from the interpretation of this License, will be subject to the
exclusive jurisdiction of the competent court where the Licensor resides or
conducts its primary business.
## 15. Applicable Law
This Licence shall be governed by the law of the European Union country where
the Licensor resides or has his registered office.
This licence shall be governed by the Belgian law if:
- a litigation arises between the European Commission, as a Licensor, and any
- Licensee; the Licensor, other than the European Commission, has no residence
- or registered office inside a European Union country.
## Appendix
“Compatible Licences” according to article 5 EUPL are:
- GNU General Public License (GNU GPL) v. 2
- Open Software License (OSL) v. 2.1, v. 3.0
- Common Public License v. 1.0
- Eclipse Public License v. 1.0
- Cecill v. 2.0

62
README.md Normal file
View File

@ -0,0 +1,62 @@
# Smartgears Distribution
A set of gCube library which empower a servlet container (e.g. tomcat) with a set of functionality such as:
- node and application infrastructure registration
- authorization
- accounting
## Structure of the project
## Built With
* [OpenJDK](https://openjdk.java.net/) - The JDK used
* [Maven](https://maven.apache.org/) - Dependency Management
## Documentation
[SmartGears](https://wiki.gcube-system.org/gcube/SmartGears)
## Change log
See [Releases](https://code-repo.d4science.org/gCubeSystem/common-smartgears/releases).
## Authors
* **Luca Frosini** ([ORCID](https://orcid.org/0000-0003-3183-2291)) - [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience)
* **Lucio Lelii** - [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience)
* **Andrea Manzi** - CERN, Switzerland
* **Fabio Simeoni** - FAO of the UN, Italy
## How to Cite this Software
Tell people how to cite this software.
* Cite an associated paper?
* Use a specific BibTeX entry for the software?
@Manual{,
title = {Smartgears Distribution},
author = {{Frosini, Luca}, {Lelii, Lucio}, {Manzi, Andrea}, {Simeoni, Fabio}},
organization = {{ISTI - CNR}, {FAO}},
address = {{Pisa, Italy}, {Roma, Italy}},
year = 2019,
url = {http://www.gcube-system.org/}
}
## License
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
## About the gCube Framework
This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an
open-source software toolkit used for building and operating Hybrid Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies.
The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)

117
buildDistribution.sh Executable file
View File

@ -0,0 +1,117 @@
#!/bin/bash
set -e
ACCEPTED_JAVA_VERSIONS=(11 17)
NAME=smartgears-distribution
SMARTGEARS_VERSION=4.0.1-SNAPSHOT
JAVA_VERSION=11
TOMCAT_VERSION=10.1.19
PUSH_DOCKER=false
PUSH_HARBOR=false
LOGIN_HARBOR=false
MULTI_PLATFORM=false
IMAGE_VERSION=${SMARTGEARS_VERSION}-java${JAVA_VERSION}-tomcat${TOMCAT_VERSION}
BUILD_NAME=$NAME:$IMAGE_VERSION
echo "BUILD_NAME=$BUILD_NAME"
################################################################################
# Help #
################################################################################
Help()
{
# Display Help
echo "build and create docker image form smartgears distribution"
echo
echo "Syntax: buildDistribution [-g arg] [-j arg] [-p|u|h]"
echo "options:"
echo "-g arg specifies the maven [g]oal {package, install, deploy etc} default is package."
echo "-j arg specify [j]ava version (default is 11)"
echo " accepted version are: ${ACCEPTED_JAVA_VERSIONS[@]}"
echo "-m build docker image for [m]ultiple platform (must be suppported by local docker agent)"
echo "-p [p]ush image to d4science harbor (with login already done, or -l to login)"
echo "-l [l]ogin to d4science harbor"
echo "-u p[u]sh image to dockerhub (with docker login already done)"
echo "-h Print this [h]elp."
echo
echo "to build a multiplatform image and push on d4science harbor"
echo " ./buildDistribution.sh -m -l -p"
}
################################################################################
################################################################################
# Main program #
################################################################################
################################################################################
while getopts g:muplj:h flag
do
case "${flag}" in
g) GOAL=${OPTARG};;
m) MULTI_PLATFORM=true ;;
u) PUSH_DOCKER=true ;;
p) PUSH_HARBOR=true ;;
l) LOGIN_HARBOR=true ;;
j) if [[ ${ACCEPTED_JAVA_VERSIONS[@]} =~ ${OPTARG} ]]
then JAVA_VERSION=${OPTARG};
else echo "Invalid java version" && echo "accepted version are: ${ACCEPTED_JAVA_VERSIONS[@]}" && exit 1;
fi;;
h) Help
exit 0;;
*) echo "Invalid option"
exit 1;;
esac
done
if [ ${LOGIN_HARBOR} = true ];
then
./loginHarborHub.sh
fi
if [ -z $GOAL ];
then
mvn clean package;
else
mvn clean ${GOAL};
fi
if [ $MULTI_PLATFORM ];
then
echo "build multiplatform"
docker build -t $BUILD_NAME --build-arg="JAVA_VERSION=${JAVA_VERSION}" --build-arg="SMARTGEARS_VERSION=${SMARTGEARS_VERSION}" --platform=linux/amd64,linux/arm64,linux/arm/v7 .;
else
echo "build single platform"
docker build -t $BUILD_NAME --build-arg="JAVA_VERSION=${JAVA_VERSION}" --build-arg="SMARTGEARS_VERSION=${SMARTGEARS_VERSION}" . ;
fi
echo ">>> generated docker image ${IMAGE_VERSION}"
if [ ${PUSH_DOCKER} = true ];
then
DOCKER_NAME=d4science/$BUILD_NAME
docker tag $BUILD_NAME $DOCKER_NAME;
docker push $DOCKER_NAME;
echo ">>> pushed on dockerhub the image $DOCKER_NAME"
fi
if [ ${PUSH_HARBOR} = true ];
then
HARBOR_NAME=hub.dev.d4science.org/gcube/$BUILD_NAME
echo ">>> PUSHING on hub.dev.d4science.org the image $HARBOR_NAME"
docker tag $BUILD_NAME $HARBOR_NAME;
docker push $HARBOR_NAME;
echo ">>> pushed on hub.dev.d4science.org the image $HARBOR_NAME"
fi

View File

@ -1,4 +0,0 @@
gCube System - License
------------------------------------------------------------
${gcube.license}

View File

@ -1,71 +0,0 @@
The gCube System - ${name}
--------------------------------------------------
${description}
${gcube.description}
${gcube.funding}
Version
--------------------------------------------------
${version} (${buildDate})
Please see the file named "changelog.xml" in this directory for the release notes.
Authors
--------------------------------------------------
* Fabio Simeoni (fabio.simeoni@fao.org), FAO of the UN, Italy.
* Andrea Manzi (andrea.manzi@cern.ch), CERN, Switzerland
* Lucio Lelii (lucio.lelii@isti.cnr.it), Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy).
* Luca Frosini (luca.frosini-AT-isti.cnr.it), Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy).
Maintainers
-----------
* Lucio Lelii (lucio.lelii@isti.cnr.it), Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy).
* Luca Frosini (luca.frosini-AT-isti.cnr.it), Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy).
Download information
--------------------------------------------------
Source code is available from SVN:
${scm.url}
Binaries can be downloaded from the gCube website:
${gcube.website}
Installation
--------------------------------------------------
Installation documentation is available on-line in the gCube Wiki:
${gcube.wikiRoot}/SmartExecutor
Documentation
--------------------------------------------------
Documentation is available on-line in the gCube Wiki:
${gcube.wikiRoot}/SmartExecutor
Support
--------------------------------------------------
Bugs and support requests can be reported in the gCube issue tracking tool:
${gcube.issueTracking}
Licensing
--------------------------------------------------
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.

View File

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<ReleaseNotes>
<Changeset component="org.gcube.distribution.smartgears-distribution.2-2-3" date="${buildDate}">
<Change>Fixed gxHTTP dependecy to allow ETICs to build the component</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.2-2-2" date="2018-12-11">
<Change>Using gcube-bom and gcube-smartgears-bom instead of maven-smartgears-bom</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.2-2-1" date="2017-02-15">
<Change>Fixed changelog</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.2-2-0" date="2017-02-15">
<Change>Changed log level from FATAL to ERROR #9708</Change>
<Change>Added document-store-lib-accounting-service in place of document-store-lib-couchbase</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.2-1-3" date="2017-10-09">
<Change>Added logback 1.11 to support Time and Size rolling of logs</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.2-1-2" date="2017-05-02">
<Change>common-smartgear-utils re-adedd to the distribution</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.2-1-0" date="2017-02-01">
<Change>Fixed distro files</Change>
<Change>Added data-transfer service as part of the distribution</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.2-0-0" date="2016-02-08">
<Change>Added new Authorization Mechanism based on token</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.1-2-6" date="2016-01-08">
<Change>smartgears-distribution 1.2.6: set default log level to WARN (refs #2145)</Change>
<Change>smartgears-distribution 1.2.6: distribution field on monitor is missing when a smartgears node is upgraded (refs #1268)</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.1-2-5" date="2015-07-31">
<Change>Added smartgear-distribution (this project) version on ghn profile.</Change>
<Change>Added accounting and authorization libs</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.1-2-4" date="2015-07-22">
<Change>Added possibility to use WEB_CONTAINER_HOME to specify the container folder. This environment variable has priority over CATALINA_HOME in the install script.</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.1-2-3" date="2015-06-18">
<Change>Stripped version from name of the included war</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.1-2-2" date="2015-04-28">
<Change>Moved libs and war directories under target to make mvn clean properly working. The generated tar.gz remain the same</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.1-2-1" date="2015-04-15">
<Change>smartgear-distribution-bundle version is published on ghn profile</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.1-2-0" date="2014-04-04">
<Change>included smartgears-utils</Change>
<Change>upgraded clean scripts to clean the IS</Change>
<Change>added symlink for shared libs</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.1-1-0" date="2014-01-31">
<Change>JAVA 7 Release</Change>
<Change>Included wHN manager service</Change>
</Changeset>
<Changeset component="org.gcube.distribution.smartgears-distribution.1-0-0" date="2013-10-24">
<Change>First Release</Change>
</Changeset>
</ReleaseNotes>

View File

@ -1,6 +1,7 @@
#!/bin/bash
#set distro to script's parent directory
distro=$(cd ${0%/*} && echo $PWD/${0##*/})
distro=$(dirname $distro)
@ -26,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"
@ -55,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"
@ -87,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
@ -118,127 +131,134 @@ 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}"
}
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"
if [ ! -s "$ghnhome/container.xml" ]; then
if [ -z "$dryrun" ]; then
cp $distro/container.xml $ghnhome/
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.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
@ -248,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

View File

@ -1,4 +1,3 @@
<configuration scan="true" debug="false">
<appender name="FILE"

View File

@ -0,0 +1,41 @@
[node]
; mandatory
; optional fields: mode (=online), publicationFrequencyInSeconds (=60), authorizeChildrenContext (=false)
mode = offline
hostname = localhost
protocol = http
port = 8080
infrastructure = gcube
authorizeChildrenContext = true
publicationFrequencyInSeconds = 60
[properties]
; not mandatory
SmartGearsDistribution = ${project.version}
SmartGearsDistributionBundle = UnBundled
[site]
; mandatory
country = it
location = rome
;[proxy]
; not mandatory
;protocol = https
;hostname = proxy
;port = 80
[authorization]
; mandatory
; 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
;[persistence]
; not mandatory (default is LocalPersistence writing in the ghn home)
;class = utils.PersistenceWriterTest
;location = /tmp

View File

@ -1,41 +0,0 @@
<container mode='offline'>
<hostname>localhost</hostname>
<port>8080</port>
<infrastructure>gcube</infrastructure>
<!--
Add container tokens generated via portal for this host and port.
-->
<!--
<token>token1</token>
<token>token2</token>
-->
<!--
this tag enables authorize calls to this container also on VRE belonging to start tokens
-->
<!-- <authorizeChildrenContext>true</authorizeChildrenContext> -->
<site>
<country>it</country>
<location>rome</location>
<latitude>41.9000</latitude>
<longitude>12.5000</longitude>
</site>
<property name='SmartGearsDistribution' value='${project.version}' />
<property name='SmartGearsDistributionBundle' value='UnBundled' />
<!--
Add your own property value here. This values will be published on
GHN porfile in /Profile/GHNDescription/RunTimeEnv/ tag.
-->
<!--
<property name='prop1' value='val1' />
<property name='prop2' value='val2' />
-->
<publication-frequency>60</publication-frequency>
</container>

View File

@ -1,4 +1,5 @@
#!/bin/bash
[ -f /etc/profile.d/10-java-caching-proxy.sh ] && . /etc/profile.d/10-java-caching-proxy.sh
function showhelp {
echo -e "\nusage: clean-container-state [-g <ghn_home>] [-s <fileName>] [-h] \n"
@ -43,10 +44,10 @@ source "$ghnhome"/scripts/load-env "$ghnhome"
RETVAL=
if [ -z "$filename" ]; then
java org.gcube.smartgears.utils.sweeper.ContainerSweeperClient -G"$ghnhome" 1>/home/gcube/SmartGears/containerState.log
java $JAVA_OPTS org.gcube.smartgears.utils.sweeper.ContainerSweeperClient -G"$ghnhome" 1>/home/gcube/SmartGears/containerState.log
RETVAL=$?
else
java org.gcube.smartgears.utils.sweeper.ContainerSweeperClient $filename -G"$ghnhome" 1>/home/gcube/SmartGears/containerState.log
java $JAVA_OPTS 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"

View File

@ -21,6 +21,12 @@
<fileMode>755</fileMode>
<filtered>true</filtered>
</fileSet>
<fileSet>
<outputDirectory>/config/apps</outputDirectory>
<directory>${distroDirectory}/config/apps</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<fileMode>755</fileMode>
</fileSet>
<fileSet>
<directory>${distroDirectory}/contents</directory>
<outputDirectory>/</outputDirectory>
@ -47,8 +53,8 @@
</fileSets>
<files>
<file>
<source>${distroDirectory}/contents/samplecontainer.xml</source>
<destName>container.xml</destName>
<source>${distroDirectory}/contents/samplecontainer.ini</source>
<destName>container.ini</destName>
<filtered>true</filtered>
</file>
</files>

13
loginHarborHub.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
REGISTRY_URL="hub.dev.d4science.org"
#USERNAME="alfredo.oliviero"
echo "to obtain Harbor username and CLI secret:"
echo "https://hub.dev.d4science.org/ -> user profile -> CLI secret"
read -p "username:" USERNAME
echo ""
read -s -p "CLI secret:" ACCESS_TOKEN
echo "$ACCESS_TOKEN" | docker login $REGISTRY_URL -u $USERNAME --password-stdin
unset ACCESS_TOKEN

85
pom.xml
View File

@ -1,63 +1,86 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.1.0</version>
<version>1.2.0</version>
</parent>
<groupId>org.gcube.distribution</groupId>
<artifactId>smartgears-distribution</artifactId>
<version>2.5.3</version>
<version>4.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>A distribution for the SmartGears Framework</name>
<properties>
<distroDirectory>distro</distroDirectory>
<wiki>https://wiki.gcube-system.org/gcube/SmartGears</wiki>
</properties>
<scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</url>
</scm>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-smartgears-bom</artifactId>
<version>1.1.0</version>
<version>3.0.1-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-smartgears</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-smartgears-utils</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>gxHTTP</artifactId>
<artifactId>gxHTTP</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-encryption</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.information-system</groupId>
<artifactId>information-system-model</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.resource-management</groupId>
<artifactId>gcube-model</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.information-system</groupId>
<artifactId>resource-registry-client</artifactId>
<exclusions>
<exclusion>
<groupId>org.gcube.common</groupId>
<artifactId>common-utility-sg3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.information-system</groupId>
<artifactId>resource-registry-publisher</artifactId>
<exclusions>
<exclusion>
<groupId>org.gcube.common</groupId>
<artifactId>common-utility-sg3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-utility-sg4</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.data.publishing</groupId>
<artifactId>document-store-lib-accounting-service</artifactId>
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
<version>[2.0.0,3.0.0-SNAPSHOT)</version>
<scope>runtime</scope>
</dependency>
<dependency>
@ -68,20 +91,30 @@
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-smartgears</artifactId>
<version>[2.0.0,3.0.0-SNAPSHOT)</version>
<version>[4.0.0-SNAPSHOT,5.0.0-SNAPSHOT)</version>
<classifier>probe</classifier>
<type>war</type>
</dependency>
<!-- publisher connectors -->
<dependency>
<groupId>org.gcube.information-system</groupId>
<artifactId>resource-registry-publisher-connector</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.common.core</groupId>
<artifactId>legacy-is-publisher-connector</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.gcube.resourcemanagement</groupId>
<artifactId>whn-manager</artifactId>
<version>[2.0.0,3.0.0-SNAPSHOT)</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.gcube.data.transfer</groupId>
<artifactId>data-transfer-service</artifactId>
<version>[2.0.0,3.0.0-SNAPSHOT)</version>
<version>[3.0.0-SNAPSHOT,4.0.0-SNAPSHOT)</version>
<type>war</type>
</dependency>
</dependencies>
@ -122,8 +155,6 @@
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
@ -147,4 +178,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

View File

@ -0,0 +1,22 @@
#!/bin/bash
logs=/etc/logback.xml
container=/etc/container.ini
configfolder=/etc/config
if [ -f "$logs" ]; then
cp $logs /tomcat/lib
fi
if [ -f "$container" ]; then
cp $container /smartgears-distribution
fi
if [ -d "$configfolder" ]; then
echo "config folder exists"
cp -R $configfolder/* /smartgears-distribution/config/apps/
fi
exec "$@"