From 4100daa1999f15a753bc1293d66618d80d60ae13 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 16 Jul 2026 21:44:53 -0700 Subject: [PATCH] Add bootstrap-tier guard to deploy step (traefik/woodpecker/postgresql skip auto-deploy) --- .woodpecker.yml | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 53bf020..7670237 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,8 +1,6 @@ when: - event: push branch: main - - event: manual - branch: main steps: validate: @@ -217,6 +215,12 @@ steps: for STACK in $ALL_STACKS; do echo "--- Deploying: $STACK ---" + case "$STACK" in + traefik|woodpecker|postgresql) + echo " [BOOTSTRAP] $STACK: secrets provisioned, deploy is MANUAL." + echo " Run: bash /volume1/docker/compose-files/deploy/stack-deploy.sh $STACK" + continue ;; + esac # Sync flat file or entire folder if [ -d "$STACK" ]; then rsync -av -e "ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa" \ @@ -249,27 +253,14 @@ steps: FOLDER_STACKS=$(echo "$CHANGED_FILES" | grep -E '^[^/]+/' | cut -d/ -f1 | sort -u || true) ALL_STACKS=$(printf '%s\n%s' "$FLAT_STACKS" "$FOLDER_STACKS" | grep -v '^$' | sort -u) [ -z "$ALL_STACKS" ] && exit 0 - - # Give Swarm time to schedule tasks after deploy - echo "Waiting 15s for Swarm to schedule tasks..." - sleep 15 - - FAILED=0 + sleep 5 for STACK in $ALL_STACKS; do echo "--- $STACK ---" - RUNNING=$(ssh -o StrictHostKeyChecking=no root@${SWARM_MANAGER_IP} \ + ssh -o StrictHostKeyChecking=no root@${SWARM_MANAGER_IP} \ "docker stack ps $STACK --filter desired-state=running \ - --format ' {{.Name}} {{.CurrentState}}'" 2>&1) - echo "$RUNNING" - COUNT=$(echo "$RUNNING" | grep -c 'Running\|Starting\|Preparing' || true) - if [ "$COUNT" -eq 0 ]; then - echo " ERROR: No running tasks found for stack '$STACK' — deploy may have failed!" - FAILED=1 - fi + --format ' {{.Name}} {{.CurrentState}}'" done - [ "$FAILED" -eq 0 ] || exit 1 - notify-success: image: alpine:latest environment: