Set the VALUES_FILE env
This commit is contained in:
parent
cbefc54227
commit
fd817b5334
@ -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!"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user