use update job template

This commit is contained in:
Andrew Dolgov 2024-02-18 19:43:35 +03:00
parent 6a51afcfcb
commit fc95c988cf
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
1 changed files with 16 additions and 28 deletions

View File

@ -20,7 +20,7 @@ include:
file: .ci-integration-test.yml file: .ci-integration-test.yml
- project: 'ci/ci-templates' - project: 'ci/ci-templates'
ref: master ref: master
file: .ci-deploy-helm-chart.yml file: .ci-update-helm-imagetag.yml
phpunit: phpunit:
extends: .phpunit extends: .phpunit
@ -115,34 +115,22 @@ ttrss-fpm-pgsql-static:publish:
variables: variables:
DOCKERFILE: ${CI_PROJECT_DIR}/.docker/app/Dockerfile DOCKERFILE: ${CI_PROJECT_DIR}/.docker/app/Dockerfile
update-prod:
image: ${INFRA_IMAGE}
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/tt-rss-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
update-demo: update-demo:
image: ${INFRA_IMAGE} extends: .update-helm-imagetag
variables:
CHART_REPO: gitlab.fakecake.org/git/helm-charts/tt-rss.git
CHART_VALUES: values-demo.yaml
ACCESS_TOKEN: ${DEMO_HELM_TOKEN}
rules: rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $DEMO_HELM_TOKEN != null - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $DEMO_HELM_TOKEN != null
stage: publish stage: publish
script:
- git clone https://token:${DEMO_HELM_TOKEN}@gitlab.fakecake.org/git/helm-charts/tt-rss.git chart update-prod:
- cd chart extends: .update-helm-imagetag
- git config user.name "Gitlab CI" variables:
- git config user.email "noreply@example.com" CHART_REPO: gitlab.fakecake.org/git/helm-charts/tt-rss-prod.git
- yq -ei '.imageTag = "'${CI_COMMIT_SHORT_SHA}'"' values-demo.yaml CHART_VALUES: values-prod.yaml
- git diff ACCESS_TOKEN: ${PROD_HELM_TOKEN}
- git add . rules:
- git commit -m "update image tag to ${CI_COMMIT_SHORT_SHA}" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $PROD_HELM_TOKEN != null
- git push origin master stage: publish