From aaa3638fbd60df05de586c2ea12ddb89c996fd34 Mon Sep 17 00:00:00 2001 From: Frank Sauerburger <frank@sauerburger.com> Date: Wed, 14 Feb 2024 18:39:07 +0100 Subject: [PATCH] Move rules:if outside of component --- README.md | 7 ++++++- templates/kaniko-build.yml | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7663e2a..60a9255 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,11 @@ stages: include: - component: gitlab.sauerburger.com/sauerburger-it/devops/kaniko-build@0.1.0 + rules: + - if: $CI_COMMIT_TAG + - component: gitlab.sauerburger.com/sauerburger-it/devops/kaniko-build@0.1.0 + rules: + - if: $CI_COMMIT_TAG inputs: - name: second-image # Overwrite image name to \ No newline at end of file + name: second-image # Overwrite image name to allow multiple jobs \ No newline at end of file diff --git a/templates/kaniko-build.yml b/templates/kaniko-build.yml index cb95830..95c5aea 100644 --- a/templates/kaniko-build.yml +++ b/templates/kaniko-build.yml @@ -29,8 +29,6 @@ $[[ inputs.name ]]: image: name: gcr.io/kaniko-project/executor:$[[ inputs.kaniko_tag ]] entrypoint: [""] - rules: - - if: $CI_COMMIT_TAG script: - echo "{\"auths\":{\"$[[ inputs.registry ]]\":{\"auth\":\"$(printf "%s:%s" "$[[ inputs.registry_user ]]" "$[[ inputs.registry_password ]]" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json - /kaniko/executor -- GitLab