From 6dd9c27813f79b1c92479c0921da487c2d691b16 Mon Sep 17 00:00:00 2001 From: Rebecca Valente Date: Tue, 8 Jul 2025 12:27:08 -0300 Subject: [PATCH] devops: added configuration and commands for generating and pushing kubernetes manifests in the gitlab ci pipeline. --- ...generate-and-push-to-local-repository.gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jobs/helm-chart-generate-and-push-to-local-repository.gitlab-ci.yml b/jobs/helm-chart-generate-and-push-to-local-repository.gitlab-ci.yml index 320595d..f1f1ca6 100644 --- a/jobs/helm-chart-generate-and-push-to-local-repository.gitlab-ci.yml +++ b/jobs/helm-chart-generate-and-push-to-local-repository.gitlab-ci.yml @@ -1,4 +1,5 @@ Generate and Push Kubernetes Manifests: + image: rbvtopudding/devops:latest stage: deploy before_script: - | @@ -9,17 +10,26 @@ Generate and Push Kubernetes Manifests: else export ENVIRONMENT="dev"; fi + script: - helm dependency update ${HELM_CHART_PATH} - rm -rf .k8s/${ENVIRONMENT}/manifests - mkdir -p .k8s/${ENVIRONMENT}/manifests - | helm template \ + --values ${HELM_CHART_VALUES_PATH} \ + ${HELM_CHART_EXTRA_OPTS} \ ${HELM_CHART_NAME} \ ${HELM_CHART_PATH} \ --output-dir /tmp/manifests - mv /tmp/manifests/${HELM_CHART_NAME}/templates/*.yaml .k8s/${ENVIRONMENT}/manifests/ - rm -rf /tmp/manifests/${HELM_CHART_NAME} + - git config --global user.name "$CI_PROJECT_NAME" + - git config --global user.email "${CI_COMMIT_AUTHOR_EMAIL}" + - | + echo ${CI_PROJECT_URL} | \ + sed 's/https:\/\///' | \ + xargs -I## git remote add remote_origin "https://oauth2:${COMMIT_TOKEN}@##.git" - git add --all - git commit -m "[${ENVIRONMENT}] manifests updated, [ci skip]" - git push -o ci.skip