From 3837f1aabcd0c9239c7e09b5ddeb8f14ac463b67 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 18 Feb 2024 19:30:15 +0300 Subject: move to template --- .gitlab-ci.yml | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2bfbd7d..2c17a32 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ include: file: .ci-lint-common.yml - project: 'ci/ci-templates' ref: master - file: .ci-deploy-helm-chart.yml + file: .ci-update-helm-imagetag.yml eslint: extends: .eslint @@ -54,33 +54,19 @@ the-epube-web-nginx:branch: DOCKERFILE: ${CI_PROJECT_DIR}/.docker/web-nginx/Dockerfile update-demo: - image: ${INFRA_IMAGE} + extends: .update-helm-imagetag + variables: + CHART_REPO: gitlab.fakecake.org/git/helm-charts/the-epube.git + ACCESS_TOKEN: ${DEMO_HELM_TOKEN} rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $DEMO_HELM_TOKEN != null stage: publish - script: - - git clone https://token:${DEMO_HELM_TOKEN}@gitlab.fakecake.org/git/helm-charts/the-epube.git chart - - cd chart - - git config user.name "Gitlab CI" - - git config user.email "noreply@example.com" - - yq -ei '.imageTag = "'${CI_COMMIT_SHORT_SHA}'"' values-demo.yaml - - git diff - - git add . - - git commit -m "update image tag to ${CI_COMMIT_SHORT_SHA}" - - git push origin master update-prod: - image: ${INFRA_IMAGE} + extends: .update-helm-imagetag + variables: + CHART_REPO: gitlab.fakecake.org/git/helm-charts/the-epube-prod.git + ACCESS_TOKEN: ${PROD_HELM_TOKEN} rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $PROD_HELM_TOKEN != null stage: publish - script: - - git clone https://token:${PROD_HELM_TOKEN}@gitlab.fakecake.org/git/helm-charts/the-epube-prod.git chart - - cd chart - - git config user.name "Gitlab CI" - - git config user.email "noreply@example.com" - - yq -ei '.imageTag = "'${CI_COMMIT_SHORT_SHA}'"' values-prod.yaml - - git diff - - git add . - - git commit -m "update image tag to ${CI_COMMIT_SHORT_SHA}" - - git push origin master -- cgit v1.2.3