From c93d7accfb56cc597dd2e2f353e6460c5b433216 Mon Sep 17 00:00:00 2001 From: Thomas Steinbach Date: Sat, 13 Mar 2021 10:55:56 +0100 Subject: [PATCH] use PredefinedVariables.CI_COMMIT_REF_SLUG as default image tag for kaniko builds --- gcip/addons/kaniko/jobs.py | 3 +++ setup.cfg | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gcip/addons/kaniko/jobs.py b/gcip/addons/kaniko/jobs.py index d9d0fb4..1847187 100644 --- a/gcip/addons/kaniko/jobs.py +++ b/gcip/addons/kaniko/jobs.py @@ -82,6 +82,9 @@ def execute( if image_name is None: image_name = PredefinedVariables.CI_PROJECT_NAME + if not image_tag and PredefinedVariables.CI_COMMIT_REF_SLUG: + image_tag = PredefinedVariables.CI_COMMIT_REF_SLUG + image_tag_postfix = "" if image_tag: image_tag_postfix = f":{image_tag}" diff --git a/setup.cfg b/setup.cfg index 3614813..7c9bf31 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ statistics = True doctests = True max_line_length = 140 max_doc_length = 140 -max-complexity = 22 +max-complexity = 25 [yapf] arithmetic_precedence_indication=True