#!/bin/bash set -e echo "🔄 Cloning repositories..." REPOS=("dev-tools" "infra" "observability-stack") rm -rf .tmp-repos mkdir -p .tmp-repos for REPO in "${REPOS[@]}"; do git clone https://${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/${REPO}.git .tmp-repos/${REPO} done echo "⚙️ Generating additional-scrape-configs.yaml..." python3 automation/generate-scrape-config.py echo "📦 Copying into observability-stack repo..." cp observability-stack/manifests/prometheus-scrape-secret/additional-scrape-configs.yaml \ .tmp-repos/observability-stack/manifests/prometheus-scrape-secret/additional-scrape-configs.yaml cd .tmp-repos/observability-stack git config user.name "auto-sync" git config user.email "sync@dvirlabs.com" if git diff --quiet; then echo "✅ No changes to commit." else git add manifests/prometheus-scrape-secret/additional-scrape-configs.yaml git commit -m "auto: update Prometheus scrape config" git push origin master fi