fix(ci): allow empty QUANTENGINE_DB_PASSWORD, fix heredoc env file generation
This commit is contained in:
@@ -141,10 +141,10 @@ jobs:
|
||||
run: |
|
||||
echo "🔧 Preparing database environment..."
|
||||
|
||||
# 환경 변수 검증
|
||||
if [ -z "${{ secrets.QUANTENGINE_DB_PASSWORD }}" ]; then
|
||||
echo "❌ QUANTENGINE_DB_PASSWORD secret not configured"
|
||||
exit 1
|
||||
# QUANTENGINE_DB_PASSWORD: 미설정 시 빈 문자열로 처리 (pg_hba.conf trust 모드 대응)
|
||||
DB_PASSWORD="${{ secrets.QUANTENGINE_DB_PASSWORD }}"
|
||||
if [ -z "$DB_PASSWORD" ]; then
|
||||
echo "⚠️ QUANTENGINE_DB_PASSWORD not set — using empty password (trust auth mode)"
|
||||
fi
|
||||
|
||||
if [ -z "${{ env.QUANTENGINE_DB_NAME }}" ] || [ -z "${{ env.QUANTENGINE_DB_USER }}" ]; then
|
||||
@@ -154,9 +154,10 @@ jobs:
|
||||
|
||||
# 환경 파일 생성
|
||||
mkdir -p ./deploy
|
||||
cat > ./deploy/quantengine.env <<EOF
|
||||
ConnectionStrings__DefaultConnection=Host=127.0.0.1;Database=${{ env.QUANTENGINE_DB_NAME }};Username=${{ env.QUANTENGINE_DB_USER }};Password=${{ secrets.QUANTENGINE_DB_PASSWORD }};Search Path=quantengine;
|
||||
EOF
|
||||
printf 'ConnectionStrings__DefaultConnection=Host=127.0.0.1;Database=%s;Username=%s;Password=%s;Search Path=quantengine;\n' \
|
||||
"${{ env.QUANTENGINE_DB_NAME }}" \
|
||||
"${{ env.QUANTENGINE_DB_USER }}" \
|
||||
"$DB_PASSWORD" > ./deploy/quantengine.env
|
||||
chmod 600 ./deploy/quantengine.env
|
||||
|
||||
# 파일 검증
|
||||
|
||||
Reference in New Issue
Block a user