fix(ci): preserve support chat runtime configuration
Deploy Canina / deploy (push) Successful in 49s
Deploy Canina / deploy (push) Successful in 49s
This commit is contained in:
1 parent
8f8f0c36d5
commit
1cbd210be1
3 files changed
+17
No files matched your search
@@ -27,6 +27,9 @@ services:
|
||||
NPM_REGISTRY: ${NPM_REGISTRY:-}
|
||||
container_name: canino_backend_prod
|
||||
restart: always
|
||||
env_file:
|
||||
- path: .support-chat.env
|
||||
required: false
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- ENABLE_SWAGGER=false
|
||||
|
||||
@@ -66,6 +66,19 @@ fi
|
||||
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
# Inject support-chat runtime configuration from CI/CD without committing secrets.
|
||||
if [ "${SUPPORT_CHAT_KEY+x}" = x ]; then
|
||||
touch .support-chat.env
|
||||
grep -v '^SUPPORT_CHAT_KEY=' .support-chat.env > .support-chat.env.tmp || true
|
||||
printf "SUPPORT_CHAT_KEY=%s\n" "$SUPPORT_CHAT_KEY" >> .support-chat.env.tmp
|
||||
mv .support-chat.env.tmp .support-chat.env
|
||||
chmod 600 .support-chat.env
|
||||
fi
|
||||
if [ ! -s .support-chat.env ]; then
|
||||
echo "ERROR: missing .support-chat.env / SUPPORT_CHAT_KEY; refusing deployment" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ✅ فایلهای کانفیگ را از پوشهی scripts مخزن به TARGET_DIR کپی میکنیم
|
||||
echo "Copying configuration files in $TARGET_DIR..."
|
||||
cp "scripts/$COMPOSE_FILE" "docker-compose.yml"
|
||||
|
||||
Reference in new issue
Block a user