From 749b3be92788714f215f7e995fd91a7d83c2ad9f Mon Sep 17 00:00:00 2001 From: chrischristiansen-glitch Date: Sat, 23 May 2026 06:44:54 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20add=20scripts/cleanup-old-runs.sh=20?= =?UTF-8?q?=E2=80=94=20delete=20legacy=20Cloud=20Run=20services?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/cleanup-old-runs.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 scripts/cleanup-old-runs.sh diff --git a/scripts/cleanup-old-runs.sh b/scripts/cleanup-old-runs.sh new file mode 100644 index 0000000..1a1479a --- /dev/null +++ b/scripts/cleanup-old-runs.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# cleanup-old-runs.sh — Delete legacy Cloud Run services from pre-OSVauco era +# Run once: source .env && bash scripts/cleanup-old-runs.sh +set -euo pipefail + +: "${PROJECT_ID:?Set PROJECT_ID}" +: "${REGION:?Set REGION}" + +SERVICES=( + "genai-app-vaucooscommandhub-l" + "genai-app-vaucooscommandhub-dev" + "opax-mcp-core" + "vauco-os-codeoss-chat" +) + +echo "=== Deleting legacy Cloud Run services ===" +echo " Project: $PROJECT_ID" +echo " Region: $REGION" +echo "" + +for SVC in "${SERVICES[@]}"; do + if gcloud run services describe "$SVC" \ + --project="$PROJECT_ID" \ + --region="$REGION" &>/dev/null; then + gcloud run services delete "$SVC" \ + --project="$PROJECT_ID" \ + --region="$REGION" \ + --quiet + echo " [OK] Deleted: $SVC" + else + echo " [--] Not found (already gone): $SVC" + fi +done + +echo "" +echo "=== Cleanup COMPLETE ==="