fix: remove docker service update redundante que causava downtime
O step "Ensure Convex service envs" fazia docker service update para adicionar env vars que já são passadas pelo stack.yml via substituição de variáveis. Isso disparava um rolling update desnecessário com ~60s de downtime a cada deploy. As env vars (MACHINE_PROVISIONING_SECRET, etc) já são definidas no stack.yml e interpoladas do .env durante o docker stack deploy. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5e4b3fd5a5
commit
b916ce3083
1 changed files with 3 additions and 25 deletions
28
.github/workflows/ci-cd-web-desktop.yml
vendored
28
.github/workflows/ci-cd-web-desktop.yml
vendored
|
|
@ -296,31 +296,9 @@ jobs:
|
||||||
echo "Using APP_DIR (stable)=$APP_DIR_STABLE"
|
echo "Using APP_DIR (stable)=$APP_DIR_STABLE"
|
||||||
APP_DIR="$APP_DIR_STABLE" RELEASE_SHA=${{ github.sha }} docker stack deploy --with-registry-auth -c stack.yml sistema
|
APP_DIR="$APP_DIR_STABLE" RELEASE_SHA=${{ github.sha }} docker stack deploy --with-registry-auth -c stack.yml sistema
|
||||||
|
|
||||||
- name: Ensure Convex service envs (sem force restart)
|
# Removido: "Ensure Convex service envs" - as env vars já são passadas pelo stack.yml
|
||||||
run: |
|
# via substituição de variáveis do .env. Fazer docker service update aqui causava
|
||||||
cd "$EFFECTIVE_APP_DIR"
|
# um rolling update adicional desnecessário com ~60s de downtime.
|
||||||
set -o allexport
|
|
||||||
if [ -f .env ]; then . ./.env; fi
|
|
||||||
set +o allexport
|
|
||||||
echo "Ensuring Convex envs on service: sistema_convex_backend"
|
|
||||||
# Acumula todas as env vars em um único update para evitar múltiplos restarts
|
|
||||||
UPDATE_ARGS=""
|
|
||||||
if [ -n "${MACHINE_PROVISIONING_SECRET:-}" ]; then
|
|
||||||
UPDATE_ARGS="$UPDATE_ARGS --env-add MACHINE_PROVISIONING_SECRET=${MACHINE_PROVISIONING_SECRET}"
|
|
||||||
fi
|
|
||||||
if [ -n "${MACHINE_TOKEN_TTL_MS:-}" ]; then
|
|
||||||
UPDATE_ARGS="$UPDATE_ARGS --env-add MACHINE_TOKEN_TTL_MS=${MACHINE_TOKEN_TTL_MS}"
|
|
||||||
fi
|
|
||||||
if [ -n "${FLEET_SYNC_SECRET:-}" ]; then
|
|
||||||
UPDATE_ARGS="$UPDATE_ARGS --env-add FLEET_SYNC_SECRET=${FLEET_SYNC_SECRET}"
|
|
||||||
fi
|
|
||||||
if [ -n "$UPDATE_ARGS" ]; then
|
|
||||||
echo "Applying env updates (will respect update_config.order: start-first)..."
|
|
||||||
docker service update $UPDATE_ARGS sistema_convex_backend || true
|
|
||||||
fi
|
|
||||||
echo "Current envs:"
|
|
||||||
docker service inspect sistema_convex_backend --format '{{range .Spec.TaskTemplate.ContainerSpec.Env}}{{println .}}{{end}}' || true
|
|
||||||
# NÃO fazemos --force aqui para respeitar a estratégia start-first do stack.yml
|
|
||||||
|
|
||||||
- name: Smoke test — register + heartbeat
|
- name: Smoke test — register + heartbeat
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue