From 94d78626a7c99886c9deda6a6f6fea4e3b48eeac Mon Sep 17 00:00:00 2001 From: Sergiy Markin Date: Tue, 22 Aug 2023 22:58:29 +0000 Subject: [PATCH] Published docker image tags This PS removes static tags from published docker image. We only want to have branch name and commitid as tags for the images in this branch. Change-Id: I1d149602f17d1a56c3e8c3ee827f5a85cd1df867 --- .zuul.yaml | 8 ++++---- tools/gate/playbooks/docker-image-build.yaml | 2 -- tools/gate/playbooks/vars.yaml | 19 ------------------- tools/image_tags.py | 10 +++++++++- 4 files changed, 13 insertions(+), 26 deletions(-) delete mode 100644 tools/gate/playbooks/vars.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 7cb91537..00b8de24 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -160,6 +160,7 @@ timeout: 3600 run: tools/gate/playbooks/docker-image-build.yaml nodeset: armada-single-node-focal + branches: airflow_1.10.5 secrets: - airship_armada_quay_creds vars: @@ -169,14 +170,14 @@ dynamic: branch: true commit: true - static: - - deprecated + - job: name: armada-docker-publish-ubuntu_bionic timeout: 3600 run: tools/gate/playbooks/docker-image-build.yaml nodeset: armada-single-node + branches: airflow_1.10.5 secrets: - airship_armada_quay_creds vars: @@ -186,8 +187,7 @@ dynamic: branch: true commit: true - static: - - deprecated + - secret: name: airship_armada_quay_creds diff --git a/tools/gate/playbooks/docker-image-build.yaml b/tools/gate/playbooks/docker-image-build.yaml index 0ea0e044..4d193b6d 100644 --- a/tools/gate/playbooks/docker-image-build.yaml +++ b/tools/gate/playbooks/docker-image-build.yaml @@ -21,8 +21,6 @@ tasks: - - include_vars: vars.yaml - - name: Debug tag generation inputs block: - debug: diff --git a/tools/gate/playbooks/vars.yaml b/tools/gate/playbooks/vars.yaml deleted file mode 100644 index c89b7980..00000000 --- a/tools/gate/playbooks/vars.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2017 The Openstack-Helm Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -docker_daemon: - group: zuul - registry-mirrors: - - "http://{{ zuul_site_mirror_fqdn }}:8082/" - storage-driver: overlay2 diff --git a/tools/image_tags.py b/tools/image_tags.py index be28669d..b5d39367 100644 --- a/tools/image_tags.py +++ b/tools/image_tags.py @@ -18,6 +18,7 @@ import logging import os import sys +# logging.basicConfig(level=logging.DEBUG) LOG = logging.getLogger(__name__) LOG_FORMAT = '%(asctime)s %(levelname)-8s %(name)s:%(filename)s:%(lineno)3d:%(funcName)s %(message)s' # noqa @@ -51,7 +52,7 @@ def read_config(stream, env): def build_tags(config): tags = config.get('tags', {}).get('static', []) - LOG.debug('Dynamic tags: %s', tags) + LOG.debug('Static tags: %s', tags) tags.extend(build_dynamic_tags(config)) LOG.info('All tags: %s', tags) return tags @@ -95,6 +96,13 @@ def _valid_dg(config, dynamic_tag, context_name=None): if context_name is None: context_name = dynamic_tag + LOG.debug('dynamic_tag: %s', dynamic_tag) + LOG.debug('dynamic_tags: %s', config.get('tags', {}).get('dynamic', {})) + LOG.debug('dynamic_tag_value: %s', config.get('context', {})) + LOG.debug('context: %s', dynamic_tag) + LOG.debug('context_name: %s', context_name) + LOG.debug('context_name_value: %s', config.get('context', {}).get(context_name)) + if config.get('tags', {}).get('dynamic', {}).get(dynamic_tag): if config.get('context', {}).get(context_name): return True