From 9944031eea36137d125073fedb9b66a1033e906f Mon Sep 17 00:00:00 2001 From: Kelly Date: Thu, 11 Dec 2025 16:40:53 -0700 Subject: [PATCH] ci: Add worker resilience check to deploy step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If workers are scaled to 0, CI will now automatically scale them to 5 before updating the image. This prevents workers from being stuck at 0 if manually scaled down for maintenance. The check only scales up if replicas=0, so it won't interfere with normal deployments or HPA scaling. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .woodpecker.yml | 2 ++ .woodpecker/ci.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index f560ec80..73da923c 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -176,6 +176,8 @@ steps: - kubectl rollout status deployment/scraper -n dispensary-scraper --timeout=300s # Note: Migrations run automatically at startup via auto-migrate # Deploy remaining services + # Resilience: ensure workers are scaled up if at 0 + - REPLICAS=$(kubectl get deployment scraper-worker -n dispensary-scraper -o jsonpath='{.spec.replicas}'); if [ "$REPLICAS" = "0" ]; then echo "Scaling workers from 0 to 5"; kubectl scale deployment/scraper-worker --replicas=5 -n dispensary-scraper; fi - kubectl set image deployment/scraper-worker worker=code.cannabrands.app/creationshop/dispensary-scraper:${CI_COMMIT_SHA:0:8} -n dispensary-scraper - kubectl set image deployment/cannaiq-frontend cannaiq-frontend=code.cannabrands.app/creationshop/cannaiq-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper - kubectl set image deployment/findadispo-frontend findadispo-frontend=code.cannabrands.app/creationshop/findadispo-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper diff --git a/.woodpecker/ci.yml b/.woodpecker/ci.yml index f560ec80..73da923c 100644 --- a/.woodpecker/ci.yml +++ b/.woodpecker/ci.yml @@ -176,6 +176,8 @@ steps: - kubectl rollout status deployment/scraper -n dispensary-scraper --timeout=300s # Note: Migrations run automatically at startup via auto-migrate # Deploy remaining services + # Resilience: ensure workers are scaled up if at 0 + - REPLICAS=$(kubectl get deployment scraper-worker -n dispensary-scraper -o jsonpath='{.spec.replicas}'); if [ "$REPLICAS" = "0" ]; then echo "Scaling workers from 0 to 5"; kubectl scale deployment/scraper-worker --replicas=5 -n dispensary-scraper; fi - kubectl set image deployment/scraper-worker worker=code.cannabrands.app/creationshop/dispensary-scraper:${CI_COMMIT_SHA:0:8} -n dispensary-scraper - kubectl set image deployment/cannaiq-frontend cannaiq-frontend=code.cannabrands.app/creationshop/cannaiq-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper - kubectl set image deployment/findadispo-frontend findadispo-frontend=code.cannabrands.app/creationshop/findadispo-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper