From e1af22962eacae67bfd27a5578d654d9341d50ec Mon Sep 17 00:00:00 2001 From: Alfredo Oliviero Date: Fri, 24 May 2024 17:06:25 +0200 Subject: [PATCH] config and script --- dockerize/docker.conf | 21 ++++++++++++--------- dockerize/pull_docker.sh | 9 ++++++--- dockerize/start_docker.sh | 11 +++++++---- dockerize/stop_docker.sh | 5 +++-- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/dockerize/docker.conf b/dockerize/docker.conf index 4785c28..a96b5e7 100644 --- a/dockerize/docker.conf +++ b/dockerize/docker.conf @@ -1,9 +1,12 @@ -BUILD_VERSION=0.0.1-SNAPSHOT -JAVA_VERSION=11 -SMARTGEARS_VERSION=4.0.1-SNAPSHOT -IMAGE_VERSION=${BUILD_VERSION}-java${JAVA_VERSION}-smartgears${SMARTGEARS_VERSION} -NAME=helloworld - -BUILD_NAME=$NAME:$IMAGE_VERSION -HARBOR_IMAGE_NAME=hub.dev.d4science.org/gcube/$BUILD_NAME -DOCKER_IMAGE=$HARBOR_IMAGE_NAME +MVN_VERSION: 1.0.0-SNAPSHOT +MVN_NAME: hello-world-service +MVN_FINALNAME: hello-world-service-1.0.0-SNAPSHOT +JAVA_VERSION: 11 +TOMCAT_VERSION: tomcat10.1.19 +SMARTGEARS_VERSION: 4.0.1-SNAPSHOT +CONTAINER_INI: ./dockerize/configuration/container.ini +IMAGE_VERSION: 1.0.0-SNAPSHOT-java11-smartgears4.0.1-SNAPSHOT +DOCKER_BUILD_NAME: hello-world-service:1.0.0-SNAPSHOT-java11-smartgears4.0.1-SNAPSHOT +SMARTGEAR_IMAGE: hub.dev.d4science.org/gcube/smartgears-distribution:4.0.1-SNAPSHOT-java11-tomcat10.1.19 +DOCKER_IMAGE_NAME: d4science/hello-world-service:1.0.0-SNAPSHOT-java11-smartgears4.0.1-SNAPSHOT +HARBOR_IMAGE_NAME: hub.dev.d4science.org/gcube/hello-world-service:1.0.0-SNAPSHOT-java11-smartgears4.0.1-SNAPSHOT diff --git a/dockerize/pull_docker.sh b/dockerize/pull_docker.sh index 13a8026..05c16b2 100755 --- a/dockerize/pull_docker.sh +++ b/dockerize/pull_docker.sh @@ -1,9 +1,12 @@ #!/bin/sh set -a -. ./docker.conf -docker pull $DOCKER_IMAGE +# source build_conf > docker.conf # generate current conf +# source docker.conf +source build_conf -echo "Docker image $DOCKER_IMAGE" +docker pull $HARBOR_IMAGE_NAME + +echo "Docker image $HARBOR_IMAGE_NAME" set +a diff --git a/dockerize/start_docker.sh b/dockerize/start_docker.sh index 842851d..2235079 100755 --- a/dockerize/start_docker.sh +++ b/dockerize/start_docker.sh @@ -1,9 +1,12 @@ #!/bin/sh set -a -. ./docker.conf -echo "Docker image $DOCKER_IMAGE" -docker pull $DOCKER_IMAGE -docker run -d -p 9991:8080 --name $NAME $DOCKER_IMAGE +# source build_conf > docker.conf # generate current conf +# source docker.conf +source build_conf + +echo "Docker image $HARBOR_IMAGE_NAME" +docker pull $HARBOR_IMAGE_NAME +docker run -d -p 9991:8080 --name $NAME $HARBOR_IMAGE_NAME set +a diff --git a/dockerize/stop_docker.sh b/dockerize/stop_docker.sh index 367aadc..1d74417 100755 --- a/dockerize/stop_docker.sh +++ b/dockerize/stop_docker.sh @@ -1,10 +1,11 @@ #!/bin/sh set -a -. ./docker.conf +# source build_conf > docker.conf # generate current conf +# source docker.conf +source build_conf docker stop $NAME docker rm $NAME set +a -