From 344b417c40f0f04a46016ec120ada9a71664b526 Mon Sep 17 00:00:00 2001 From: Clemens Geibel Date: Fri, 22 Jul 2022 12:38:03 +0200 Subject: [PATCH] Added docker image tagging --- infrastructure/docker-backup/build.py | 4 +++- infrastructure/docker-nextcloud/build.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/infrastructure/docker-backup/build.py b/infrastructure/docker-backup/build.py index 66b2d09..4fac93c 100644 --- a/infrastructure/docker-backup/build.py +++ b/infrastructure/docker-backup/build.py @@ -21,8 +21,10 @@ def initialize(project): dockerhub_password = environ.get('DOCKERHUB_PASSWORD') if not dockerhub_password: dockerhub_password = gopass_password_from_path('meissa/web/docker.com') + if not tag: + tag = get_tag_from_latest_commit() config = create_devops_docker_build_config( - stage, PROJECT_ROOT_PATH, MODULE, dockerhub_user, dockerhub_password) + stage, PROJECT_ROOT_PATH, MODULE, dockerhub_user, dockerhub_password, docker_publish_tag=tag) build = MyBuild(project, config) build.initialize_build_dir() diff --git a/infrastructure/docker-nextcloud/build.py b/infrastructure/docker-nextcloud/build.py index 36d085a..fdc14af 100644 --- a/infrastructure/docker-nextcloud/build.py +++ b/infrastructure/docker-nextcloud/build.py @@ -21,8 +21,11 @@ def initialize(project): dockerhub_password = environ.get('DOCKERHUB_PASSWORD') if not dockerhub_password: dockerhub_password = gopass_password_from_path('meissa/web/docker.com') + tag = environ.get('CI_COMMIT_TAG') + if not tag: + tag = get_tag_from_latest_commit() config = create_devops_docker_build_config( - stage, PROJECT_ROOT_PATH, MODULE, dockerhub_user, dockerhub_password) + stage, PROJECT_ROOT_PATH, MODULE, dockerhub_user, dockerhub_password, docker_publish_tag=tag) build = MyBuild(project, config) build.initialize_build_dir()