From fd817b5334b06b2c3ea7cdbc8cc3014636f60f65 Mon Sep 17 00:00:00 2001 From: dvirlabs Date: Wed, 18 Feb 2026 11:01:52 +0200 Subject: [PATCH] Set the VALUES_FILE env --- .gitlab-ci.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c01660..824910b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,6 @@ variables: NAMESPACE: "sandbox-gitlab" CHART_PATH: "./open-meteo-service" VALUES_FILE: "./values.yaml" - SERVICE_NAME: "open-meteo-service-open-meteo-service" # <-- אם אצלך שם אחר, תשנה פה build: stage: build @@ -34,16 +33,12 @@ deploy: script: |- set -euo pipefail - # Install yq if missing - if ! command -v yq >/dev/null 2>&1; then - YQ_VERSION="v4.35.1" - wget -qO /usr/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" - chmod +x /usr/bin/yq - fi - - # Update values.yaml with the new tag - /tmp/yq e ".image.tag = \"${TAG}\"" -i "${VALUES_FILE}" + # Update values.yaml with the new tag using sed + sed -i "s/^ tag: .*/ tag: \"${TAG}\"/" "${VALUES_FILE}" echo "Updated ${VALUES_FILE} with image.tag=${TAG}" + + # Verify the change + grep -A 1 "^image:" "${VALUES_FILE}" # Configure git identity git config user.email "gitlab-ci@dvirlabs.com" @@ -58,6 +53,7 @@ deploy: echo "Deploying with Helm..." helm upgrade --install "${RELEASE}" "${CHART_PATH}" \ + -f "${VALUES_FILE}" \ -n "${NAMESPACE}" \ --create-namespace \ --wait --timeout 5m @@ -66,6 +62,7 @@ deploy: kubectl -n "${NAMESPACE}" rollout status deploy -l app.kubernetes.io/name=open-meteo-service --timeout=180s echo "Port-forward for tests..." + SERVICE_NAME="${RELEASE}-open-meteo-service" kubectl -n "${NAMESPACE}" port-forward "svc/${SERVICE_NAME}" 8000:8000 >/tmp/pf.log 2>&1 & PF_PID=$! sleep 5 @@ -90,4 +87,3 @@ deploy: kill $PF_PID || true echo "All tests passed!" - \ No newline at end of file