push to docker hub too

This commit is contained in:
Wolfgang Hottgenroth 2023-11-09 17:40:49 +01:00
parent 46d840e9de
commit ef84704340
Signed by: wn
GPG Key ID: 836E9E1192A6B132
2 changed files with 17 additions and 8 deletions

View File

@ -4,6 +4,8 @@ stages:
variables: variables:
IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH
HUB_IMAGE_NAME: $DOCKER_HUB_LOGIN/$CI_PROJECT_NAME
dockerize: dockerize:
image: registry.hottis.de/dockerized/docker-bash:latest image: registry.hottis.de/dockerized/docker-bash:latest
@ -19,6 +21,12 @@ dockerize:
- if [ "$CI_COMMIT_TAG" != "" ]; then - if [ "$CI_COMMIT_TAG" != "" ]; then
docker tag $IMAGE_NAME:${CI_COMMIT_SHORT_SHA} $IMAGE_NAME:${CI_COMMIT_TAG}; docker tag $IMAGE_NAME:${CI_COMMIT_SHORT_SHA} $IMAGE_NAME:${CI_COMMIT_TAG};
docker push $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 fi
.deploy: .deploy:
@ -49,9 +57,10 @@ dockerize:
- docker network connect external-network $CONTAINER_NAME - docker network connect external-network $CONTAINER_NAME
deploy-berresheim: # deploy-berresheim:
extends: .deploy # extends: .deploy
tags: # tags:
- berresheim-deployment-only # - berresheim-deployment-only
environment: # environment:
name: berresheim-production # name: berresheim-production
#

View File

@ -1,5 +1,5 @@
create database cem_monitoring; create database cem_monitoring;
-- create extension timescaledb; create extension timescaledb;
@ -22,7 +22,7 @@ create table variable_t (
); );
create table measurement_t ( create table measurement_t (
time timestamp without time zone not null, time timestamptz not null,
variable integer references variable_t (id), variable integer references variable_t (id),
value float value float
); );