push to docker hub too

This commit is contained in:
Wolfgang Hottgenroth 2023-11-09 16:57:32 +01:00
parent 43c89031bd
commit 8099472b61
Signed by: wn
GPG Key ID: 836E9E1192A6B132
3 changed files with 27 additions and 15 deletions

2
.gitignore vendored
View File

@ -2,4 +2,6 @@ ENV
*.pyc *.pyc
.venv/* .venv/*
src/.venv/* src/.venv/*
.dccache
src/.dccache

View File

@ -4,6 +4,9 @@ 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 +22,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,16 +58,17 @@ dockerize:
$IMAGE_NAME:$CI_COMMIT_TAG $IMAGE_NAME:$CI_COMMIT_TAG
- docker network connect external-network $CONTAINER_NAME - docker network connect external-network $CONTAINER_NAME
deploy-saerbeck: # deploy-saerbeck:
extends: .deploy # extends: .deploy
tags: # tags:
- saerbeck-deployment-only # - saerbeck-deployment-only
environment: # environment:
name: saerbeck-production # 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

View File

@ -12,11 +12,11 @@ create table application_t (
); );
create table measurement_t ( create table measurement_t (
time timestamp without time zone not null, time timestamptz not null,
application_name varchar(16) not null, application_name text not null,
raw_level numeric(10, 0), raw_level numeric(10, 0),
level numeric(10, 0), level numeric(10, 0),
status varchar(16), status text,
battery float battery float
); );