Fixing project structure

This commit is contained in:
Luca Frosini 2024-05-27 18:13:35 +02:00
parent e7813e378c
commit 549f92f9b4
8 changed files with 47 additions and 39 deletions

View File

@ -1,4 +1,4 @@
# Changelog for "HelloWorld" # Changelog for "Resource Manager"
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

View File

@ -32,19 +32,19 @@ Help() {
echo "-e execute the docker image" echo "-e execute the docker image"
echo "-g arg specifies the maven [g]oals {package, install, deploy etc} default is $GOAL." echo "-g arg specifies the maven [g]oals {package, install, deploy etc} default is $GOAL."
echo "-d arg? enable java debug mode for execution" echo "-d arg? enable java debug mode for execution"
echo " arg is the debug port (default is $DEBUG_PORT)"
echo "-r push image to d4science harbo[r] (with login already done, or -l to login)" echo "-r push image to d4science harbo[r] (with login already done, or -l to login)"
echo "-u p[u]sh image to dockerhub (with docker login already done)" echo "-u p[u]sh image to dockerhub (with docker login already done)"
echo "-p arg specifies the port to be exposed for the docker container to access the service (default $PORT)" echo "-p arg specifies the port to be exposed for the docker container to access the service (default $PORT)"
echo "-c arg path of the file to deploy as container.ini (default ./docker/container.ini)" echo "-c arg path of the file to deploy as container.ini (default ./docker/container.ini)"
echo "-j arg specify java version (default is $JAVA_VERSION)" # echo "-j arg specify java version (default is $JAVA_VERSION)"
echo " accepted version are: ${ACCEPTED_JAVA_VERSIONs[@]}" # echo " accepted version are: ${ACCEPTED_JAVA_VERSIONs[@]}"
echo " arg is the debug port (default is $DEBUG_PORT)"
echo "-s skip maven package" echo "-s skip maven execution"
echo "-t exec also maven tests" echo "-t exec also maven tests"
echo "-n arg specifies the docker image name (default is $MVN_NAME)." echo "-n arg specifies the docker image name (default is $MVN_NAME)."
@ -67,8 +67,8 @@ Help() {
set -e set -e
#OPTSTRING=":sn:p:d:j:?h" #OPTSTRING=":c:n:p:g:d:?jsmulrteh"
OPTSTRING=":c:n:p:g:d:?jsmulrteh" OPTSTRING=":c:n:p:g:d:?smulrteh"
while getopts $OPTSTRING opt; do while getopts $OPTSTRING opt; do
# echo "Option -${opt} was triggered, Argument: ${OPTARG}" # echo "Option -${opt} was triggered, Argument: ${OPTARG}"
@ -94,13 +94,13 @@ while getopts $OPTSTRING opt; do
DEBUG_PORT=${OPTARG} DEBUG_PORT=${OPTARG}
echo "debug enabled, port $DEBUG_PORT, execute $EXECUTE" echo "debug enabled, port $DEBUG_PORT, execute $EXECUTE"
;; ;;
j) # j)
if [[ ${ACCEPTED_JAVA_VERSIONs[@]} =~ ${OPTARG} ]]; then # if [[ ${ACCEPTED_JAVA_VERSIONs[@]} =~ ${OPTARG} ]]; then
JAVA_VERSION=${OPTARG} # JAVA_VERSION=${OPTARG}
else # else
echo "Invalid java version" && echo "accepted version are: ${ACCEPTED_JAVA_VERSIONs[@]}" && exit 1 # echo "Invalid java version" && echo "accepted version are: ${ACCEPTED_JAVA_VERSIONs[@]}" && exit 1
fi # fi
;; # ;;
h) Help && exit 0 ;; h) Help && exit 0 ;;
:) :)
@ -147,8 +147,7 @@ echo "DOCKER_BUILD_NAME: $DOCKER_BUILD_NAME"
--build-arg="MVN_FINALNAME=$MVN_FINALNAME" \ --build-arg="MVN_FINALNAME=$MVN_FINALNAME" \
--build-arg="MVN_NAME=${MVN_NAME}" \ --build-arg="MVN_NAME=${MVN_NAME}" \
--build-arg="CONTAINER_INI=${CONTAINER_INI}" \ --build-arg="CONTAINER_INI=${CONTAINER_INI}" \
--build-arg="JAVA_VERSION=${JAVA_VERSION}" \ --build-arg="SMARTGEAR_IMAGE=${SMARTGEAR_IMAGE}" \
--build-arg="SMARTGEARS_VERSION=${SMARTGEARS_VERSION}" \
-f Dockerfile \ -f Dockerfile \
$PLATFORMS . ); $PLATFORMS . );

View File

@ -26,7 +26,7 @@ JAVA_VERSION=$(cd .. && mvn -q \
exec:exec) exec:exec)
echo "JAVA_VERSION: ${JAVA_VERSION}" echo "JAVA_VERSION: ${JAVA_VERSION}"
TOMCAT_VERSION=tomcat10.1.19 TOMCAT_VERSION=10.1.19
echo "TOMCAT_VERSION: ${TOMCAT_VERSION}" echo "TOMCAT_VERSION: ${TOMCAT_VERSION}"
SMARTGEARS_VERSION=$(cd .. && mvn -q \ SMARTGEARS_VERSION=$(cd .. && mvn -q \
@ -45,7 +45,7 @@ echo "IMAGE_VERSION: ${IMAGE_VERSION}"
DOCKER_BUILD_NAME=$MVN_NAME:$IMAGE_VERSION DOCKER_BUILD_NAME=$MVN_NAME:$IMAGE_VERSION
echo "DOCKER_BUILD_NAME: ${DOCKER_BUILD_NAME}" echo "DOCKER_BUILD_NAME: ${DOCKER_BUILD_NAME}"
SMARTGEAR_IMAGE=hub.dev.d4science.org/gcube/smartgears-distribution:${SMARTGEARS_VERSION}-java${JAVA_VERSION}-${TOMCAT_VERSION} SMARTGEAR_IMAGE=hub.dev.d4science.org/gcube/smartgears-distribution:${SMARTGEARS_VERSION}-java${JAVA_VERSION}-tomcat${TOMCAT_VERSION}
echo "SMARTGEAR_IMAGE: ${SMARTGEAR_IMAGE}" echo "SMARTGEAR_IMAGE: ${SMARTGEAR_IMAGE}"
DOCKER_IMAGE_NAME=d4science/$DOCKER_BUILD_NAME DOCKER_IMAGE_NAME=d4science/$DOCKER_BUILD_NAME

14
dockerize/pull_smartgear.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
set -a
# source build_conf > docker.conf # generate current conf
# source docker.conf
source build_conf
echo "Docker Smartgear image $SMARTGEAR_IMAGE"
# docker pull hub.dev.d4science.org/gcube/smartgears-distribution:4.0.1-SNAPSHOT-java11-tomcat10.1.19
docker pull $SMARTGEAR_IMAGE
set +a

12
dockerize/push_docker.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
set -a
# source build_conf > docker.conf # generate current conf
# source docker.conf
source build_conf
echo "Docker image $HARBOR_IMAGE_NAME"
docker push $HARBOR_IMAGE_NAME
set +a

View File

@ -4,8 +4,8 @@
xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.14.0.xsd"> xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.14.0.xsd">
<description package="org.gcube.service.idm" /> <description package="org.gcube.service.idm" />
<api-classes> <api-classes>
<include pattern="org.gcube.service.helloworld.rest.*" /> <include pattern="org.gcube.resourcemanagement.rest.*" />
<exclude pattern="org.gcube.service.helloworld.*" /> <exclude pattern="org.gcube.resourcemanagement.*" />
</api-classes> </api-classes>
<modules> <modules>
<gwt-json-overlay disabled="true" /> <gwt-json-overlay disabled="true" />

View File

@ -2,7 +2,6 @@ package org.gcube.resourcemanagement.rest.administration;
import org.gcube.common.security.providers.SecretManagerProvider; import org.gcube.common.security.providers.SecretManagerProvider;
import org.gcube.resourcemanagement.rest.BaseREST; import org.gcube.resourcemanagement.rest.BaseREST;
import org.gcube.resourcemanagement.rest.annotation.PATCH;
import org.gcube.resourcemanagement.rest.annotation.PURGE; import org.gcube.resourcemanagement.rest.annotation.PURGE;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -19,6 +18,7 @@ import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.DefaultValue;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;
import jakarta.ws.rs.InternalServerErrorException; import jakarta.ws.rs.InternalServerErrorException;
import jakarta.ws.rs.PATCH;
import jakarta.ws.rs.POST; import jakarta.ws.rs.POST;
import jakarta.ws.rs.PUT; import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;

View File

@ -1,17 +0,0 @@
package org.gcube.resourcemanagement.rest.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import jakarta.ws.rs.HttpMethod;
/**
* @author Luca Frosini (ISTI - CNR)
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@HttpMethod("PATCH")
public @interface PATCH {
}