Commit fcfe31c4 authored by Matija Obreza's avatar Matija Obreza
Browse files

Using processed IMAGE_TAG for docker image and review deployment

parent a1d284d0
......@@ -43,14 +43,14 @@ docker image:
- cp target/*.war docker
- cd docker
- if [ "${CI_COMMIT_REF_SLUG}" = "master" ] ; then
TAG=${GENESYS_VERSION};
IMAGE_TAG=${GENESYS_VERSION};
else
TAG=${GENESYS_VERSION}-${CI_COMMIT_REF_SLUG};
IMAGE_TAG=${GENESYS_VERSION}-${CI_COMMIT_REF_SLUG};
fi
- "echo The image tag: ${TAG}"
- ${DOCKER_CMD} build -t ${CI_REGISTRY_IMAGE}:${TAG} .
- "echo The image tag: ${IMAGE_TAG}"
- ${DOCKER_CMD} build -t ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} .
- ${DOCKER_CMD} login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- ${DOCKER_CMD} push ${CI_REGISTRY_IMAGE}:${TAG}
- ${DOCKER_CMD} push ${CI_REGISTRY_IMAGE}:${IMAGE_TAG}
- ${DOCKER_CMD} logout $CI_REGISTRY
deploy for review:
......@@ -77,6 +77,11 @@ deploy for review:
- DOCKER_CMD=docker
# Actions
- apk add --no-cache gettext
- if [ "${CI_COMMIT_REF_SLUG}" = "master" ] ; then
IMAGE_TAG=${GENESYS_VERSION};
else
IMAGE_TAG=${GENESYS_VERSION}-${CI_COMMIT_REF_SLUG};
fi
- envsubst < docker/review-compose-template.yml > review-composed.yml
- cat review-composed.yml
- ${DOCKER_CMD} stack deploy -c review-composed.yml genesys-${CI_COMMIT_REF_SLUG}
......
......@@ -2,7 +2,7 @@ version: '3.1'
services:
genesys:
image: ${CI_REGISTRY_IMAGE}:${GENESYS_VERSION}-${CI_COMMIT_REF_SLUG}
image: ${CI_REGISTRY_IMAGE}:${IMAGE_TAG}
environment:
- spring.profiles.active=dev
- JAVA_OPTIONS=-Xms1800M -Xmx2800M -server -Dnetworkaddress.cache.ttl=10
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment