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