From 2d85f6c89574a564e641d2f925776ca013ce5447 Mon Sep 17 00:00:00 2001 From: dvirlabs <114520947+dvirlabs@users.noreply.github.com> Date: Thu, 19 Jun 2025 22:46:01 +0300 Subject: [PATCH] Debug --- automation/cloudflared-sync.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/automation/cloudflared-sync.sh b/automation/cloudflared-sync.sh index e0fe1fd..3dcf23f 100644 --- a/automation/cloudflared-sync.sh +++ b/automation/cloudflared-sync.sh @@ -16,8 +16,8 @@ INFRA_REPO_URL="https://git.dvirlabs.com/dvirlabs/infra.git" SANDBOX_CLONE=".tmp-repos/sandbox" INFRA_CLONE=".tmp-repos/infra" GENERATED_FILE="generated-values/cloudflared-values.yaml" -ORIGINAL_FILE="$INFRA_CLONE/cloudflared/values.yaml" -MERGED_FILE="$INFRA_CLONE/cloudflared/values.yaml" +ORIGINAL_FILE="$INFRA_CLONE/manifests/cloudflared/values.yaml" +MERGED_FILE="$INFRA_CLONE/manifests/cloudflared/values.yaml" # === STEP 1: Clone Repos === echo "📦 Cloning sandbox-apps..." @@ -57,10 +57,10 @@ echo "🔁 Merging new entries into: $ORIGINAL_FILE" TEMP_FILE=$(mktemp) -# Copy original ingress list (except null or malformed) +# Copy original ingress list yq eval '.cloudflare.ingress' "$ORIGINAL_FILE" > "$TEMP_FILE" -# Append new unique entries +# Append new unique entries (skip existing hostnames) yq eval '.ingress' "$GENERATED_FILE" | yq eval -o=json '.' - | jq -c '.[]' | while read -r new_entry; do hostname=$(echo "$new_entry" | jq -r '.hostname') service=$(echo "$new_entry" | jq -r '.service') @@ -87,10 +87,10 @@ yq eval ' echo "✅ Final merged values.yaml:" cat "$MERGED_FILE" -# === STEP 5: Optional push +# === STEP 5: Optional push to Git === # cd "$INFRA_CLONE" # git config user.name "woodpecker-bot" # git config user.email "ci@dvirlabs.com" -# git add cloudflared/values.yaml +# git add manifests/cloudflared/values.yaml # git commit -m "chore(cloudflared): auto-add ingress from sandbox" # git push