fix(deploy): skip runtime image builds on production host
This commit is contained in:
@@ -46,8 +46,12 @@ export COMPOSE_PROJECT_NAME=xiaoxia-production-app
|
||||
export WEB_DOCKERFILE=infra/docker/web-artifact.Dockerfile
|
||||
export WEB_NGINX_CONF=infra/docker/nginx-production.conf
|
||||
|
||||
docker compose --env-file "$ENV_FILE" build --pull=false api
|
||||
docker compose --env-file "$ENV_FILE" build --pull=false worker
|
||||
if [ "${ALLOW_PRODUCTION_BUILDS:-false}" = "true" ]; then
|
||||
docker compose --env-file "$ENV_FILE" build --pull=false api
|
||||
docker compose --env-file "$ENV_FILE" build --pull=false worker
|
||||
else
|
||||
echo "Skipping production API/worker image builds. Set ALLOW_PRODUCTION_BUILDS=true only on a dedicated build host."
|
||||
fi
|
||||
docker compose --env-file "$ENV_FILE" build --pull=false web
|
||||
docker compose --env-file "$ENV_FILE" run --rm --no-deps api sh -c '
|
||||
cd /app &&
|
||||
|
||||
@@ -27,6 +27,8 @@ def test_deploy_production_uses_production_infra_and_project():
|
||||
assert "Production deploy must not build frontend assets on the server" in script
|
||||
assert "WEB_DOCKERFILE=infra/docker/web-artifact.Dockerfile" in script
|
||||
assert "WEB_NGINX_CONF=infra/docker/nginx-production.conf" in script
|
||||
assert "Skipping production API/worker image builds" in script
|
||||
assert "ALLOW_PRODUCTION_BUILDS=true" in script
|
||||
assert "xiaoxia-postgres-production" in script
|
||||
assert "xiaoxia-redis-production" in script
|
||||
assert "xiaoxia-postgres\n" not in script
|
||||
|
||||
Reference in New Issue
Block a user