fix(stage): deploy Torob backend without schema writes [skip ci]

This commit is contained in:
devops committed 2026-10-14 19:38:57 +00:00
1 parent 30cebb92fa
commit f6736cd43f
2 files changed
+22

No files matched your search

+3
View File
@@ -39,6 +39,9 @@ services:
- REDIS_HOST=redis_stage
- REDIS_PORT=6379
- PORT=3000
- FRONTEND_URL=https://stage.canina.ir
# Code-only stage startup: schema/seed changes require separate authorization.
command: ["node", "dist/main.js"]
volumes:
- canina_stage_uploads:/app/uploads
- /opt/services/proxy/certs/canina:/app/ssl_certs
+19
View File
@@ -1,6 +1,25 @@
#!/bin/bash
set -e
# Explicit no-data-write stage rollout. Run only after testing and pushing HEAD.
if [ "${2:-}" = "stage-backend-only" ]; then
[ "${1:-}" = "develop" ] || exit 2
cd /opt/services/canina/stage
exec 9>/opt/services/canina/stage-backend-deploy.lock
flock -n 9 || { echo "Stage deployment already in progress"; exit 1; }
[ "$(git branch --show-current)" = develop ]
git fetch origin develop
[ "$(git rev-parse HEAD)" = "$(git rev-parse origin/develop)" ]
git diff --quiet -- backend scripts/compose.stage.yml scripts/deploy.sh
TESTED_HEAD=$(git rev-parse HEAD)
# Read tracked compose directly; preserve generated config and nginx.
docker compose -p stage -f scripts/compose.stage.yml --project-directory . build backend_stage
[ "$(git rev-parse HEAD)" = "$TESTED_HEAD" ]
git diff --quiet -- backend scripts/compose.stage.yml scripts/deploy.sh
docker compose -p stage -f scripts/compose.stage.yml --project-directory . up -d --no-deps --remove-orphans backend_stage
exit 0
fi
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1