fix(stage): deploy Torob backend without schema writes [skip ci]
This commit is contained in:
1 parent
30cebb92fa
commit
fa4f1124e6
2 files changed
+19
No files matched your search
@@ -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
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
#!/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
|
||||
# Read tracked compose directly; preserve generated config and nginx.
|
||||
docker compose -p stage -f scripts/compose.stage.yml --project-directory . build backend_stage
|
||||
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
|
||||
|
||||
|
||||
Reference in new issue
Block a user