push to docker hub too

This commit is contained in:
2023-11-09 16:57:32 +01:00
parent 43c89031bd
commit 8099472b61
3 changed files with 27 additions and 15 deletions

View File

@ -4,6 +4,9 @@ stages:
variables:
IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH
HUB_IMAGE_NAME: $DOCKER_HUB_LOGIN/$CI_PROJECT_NAME
dockerize:
image: registry.hottis.de/dockerized/docker-bash:latest
@ -19,6 +22,12 @@ dockerize:
- if [ "$CI_COMMIT_TAG" != "" ]; then
docker tag $IMAGE_NAME:${CI_COMMIT_SHORT_SHA} $IMAGE_NAME:${CI_COMMIT_TAG};
docker push $IMAGE_NAME:${CI_COMMIT_TAG};
docker login -u $DOCKER_HUB_LOGIN -p $DOCKER_HUB_PASSWORD;
docker tag $IMAGE_NAME:${CI_COMMIT_SHORT_SHA} $HUB_IMAGE_NAME:${CI_COMMIT_TAG};
docker tag $IMAGE_NAME:${CI_COMMIT_SHORT_SHA} $HUB_IMAGE_NAME:latest;
docker push $HUB_IMAGE_NAME:${CI_COMMIT_TAG};
docker push $HUB_IMAGE_NAME:latest;
fi
.deploy:
@ -49,16 +58,17 @@ dockerize:
$IMAGE_NAME:$CI_COMMIT_TAG
- docker network connect external-network $CONTAINER_NAME
deploy-saerbeck:
extends: .deploy
tags:
- saerbeck-deployment-only
environment:
name: saerbeck-production
# deploy-saerbeck:
# extends: .deploy
# tags:
# - saerbeck-deployment-only
# environment:
# name: saerbeck-production
# deploy-berresheim:
# extends: .deploy
# tags:
# - berresheim-deployment-only
# environment:
# name: berresheim-production
deploy-berresheim:
extends: .deploy
tags:
- berresheim-deployment-only
environment:
name: berresheim-production