fix: MudBlazor v8 compatibility, static asset conflict, deploy host domain
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 5s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 9s
Deploy to Production / Build & Deploy to Production (push) Failing after 2m32s

- fix CS0542: rename Users/Assets private members to _users/_assets
- fix CS0246: MudDialogInstance -> IMudDialogInstance
- fix AppTheme: PaletteLight/PaletteDark, string[] FontFamily, string typography values
- fix DataCollectionMonitoring: @(ticker.DataPointCount)개 Korean char parsing
- fix SchedulerService: add missing Hangfire namespaces, fix GetJobStatus return type
- fix Program.cs: move PostgreSQL setup above Hangfire registration
- fix ConfirmDialog: BackdropClick, Canceled spelling for MudBlazor v8
- fix static asset conflict: remove wwwroot/_framework from git tracking
- chore: add wwwroot/_framework/ to .gitignore
- ci: change DEPLOY_HOST from IP to quant.taxbaik.com domain
This commit is contained in:
2026-07-05 17:43:36 +09:00
parent 7daedbff3c
commit 543b327d27
446 changed files with 237 additions and 1494 deletions
+166 -30
View File
@@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true
env:
DEPLOY_HOST: 178.104.200.7
DEPLOY_HOST: quant.taxbaik.com
DEPLOY_USER: kjh2064
SERVICE_NAME: quantengine
DOTNET_VERSION: '10.0.x'
@@ -89,28 +89,108 @@ jobs:
- name: Setup SSH
run: |
echo "🔑 Setting up SSH configuration..."
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# SSH 키 설정
if [ -z "${{ secrets.SSH_PRIVATE_KEY }}" ]; then
echo "❌ SSH_PRIVATE_KEY secret not configured"
exit 1
fi
if echo "${{ secrets.SSH_PRIVATE_KEY }}" | grep -q "BEGIN"; then
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
else
echo "${{ secrets.SSH_PRIVATE_KEY }}" | base64 -d > ~/.ssh/id_ed25519 || echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
echo "${{ secrets.SSH_PRIVATE_KEY }}" | base64 -d > ~/.ssh/id_ed25519 2>/dev/null || echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
fi
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H ${{ env.DEPLOY_HOST }} >> ~/.ssh/known_hosts 2>/dev/null || true
- name: Prepare QuantEngine DB Env
chmod 600 ~/.ssh/id_ed25519
# SSH 키 검증
if ! ssh-keygen -l -f ~/.ssh/id_ed25519 >/dev/null 2>&1; then
echo "❌ SSH key validation failed"
exit 1
fi
# 호스트 키 스캔 (재시도)
for i in 1 2 3; do
if ssh-keyscan -t ed25519,rsa -H ${{ env.DEPLOY_HOST }} >> ~/.ssh/known_hosts 2>/dev/null; then
echo "✓ Host key added"
break
elif [ $i -lt 3 ]; then
echo " Retry $i failed, waiting..."
sleep 2
else
echo "⚠️ Host key scan failed (continuing anyway)"
fi
done
# SSH 연결 테스트
echo "Testing SSH connection..."
if ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
"${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }}" "echo ✓ SSH OK"; then
echo "✓ SSH connection verified"
else
echo "❌ SSH connection test failed"
exit 1
fi
- name: Prepare & Validate QuantEngine DB Env
run: |
echo "🔧 Preparing database environment..."
# 환경 변수 검증
if [ -z "${{ secrets.QUANTENGINE_DB_PASSWORD }}" ]; then
echo "❌ QUANTENGINE_DB_PASSWORD secret not configured"
exit 1
fi
if [ -z "${{ env.QUANTENGINE_DB_NAME }}" ] || [ -z "${{ env.QUANTENGINE_DB_USER }}" ]; then
echo "❌ DB configuration environment variables not set"
exit 1
fi
# 환경 파일 생성
mkdir -p ./deploy
cat > ./deploy/quantengine.env <<EOF
ConnectionStrings__DefaultConnection=Host=127.0.0.1;Database=${QUANTENGINE_DB_NAME};Username=${QUANTENGINE_DB_USER};Password=${{ secrets.QUANTENGINE_DB_PASSWORD }};Search Path=quantengine;
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
chmod 600 ./deploy/quantengine.env
# 파일 검증
if [ ! -f ./deploy/quantengine.env ]; then
echo "❌ Failed to create database config file"
exit 1
fi
echo "✓ Database configuration prepared"
- name: Package Artifact
run: |
tar -czf quantengine.tar.gz -C ./publish .
echo "✓ Package size: $(du -sh quantengine.tar.gz | cut -f1)"
echo "📦 Creating deployment package..."
# 패키지 생성
if ! tar -czf quantengine.tar.gz -C ./publish .; then
echo "❌ Failed to create package"
exit 1
fi
# 패키지 검증
PACKAGE_SIZE=$(du -sh quantengine.tar.gz | cut -f1)
PACKAGE_BYTES=$(stat -f%z quantengine.tar.gz 2>/dev/null || stat -c%s quantengine.tar.gz 2>/dev/null)
if [ -z "$PACKAGE_BYTES" ] || [ "$PACKAGE_BYTES" -lt 1000000 ]; then
echo "⚠️ Warning: Package seems too small ($PACKAGE_SIZE)"
fi
if [ ! -f quantengine.tar.gz ]; then
echo "❌ Package file not created"
exit 1
fi
echo "✓ Package created: $PACKAGE_SIZE"
tar -tzf quantengine.tar.gz | head -5
- name: Deploy & Verify on Server
run: |
@@ -135,43 +215,99 @@ jobs:
notify_failure() {
local exit_code=$?
local error_msg="$1"
send_telegram "❌ <b>QuantEngine 배포 실패</b>
커밋: <code>${COMMIT}</code>
시간: <code>${TIMESTAMP}</code>
단계: deploy-to-prod (SSH Execution)"
단계: ${error_msg:-deploy-to-prod}
로그: https://gitea.taxbaik.com/kjh2064/QuantEngineByItz/actions/runs/${{ github.run_id }}"
exit "$exit_code"
}
trap notify_failure ERR
trap 'notify_failure "SSH/File Transfer"' ERR
echo "=== Deploying QuantEngine $COMMIT ($TIMESTAMP) ==="
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 \
"$DEPLOY_USER@$DEPLOY_HOST" "mkdir -p /home/kjh2064/tmp"
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 \
quantengine.tar.gz "$DEPLOY_USER@$DEPLOY_HOST:/home/kjh2064/tmp/quantengine.tar.gz"
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 \
tools/deploy_quantengine.sh "$DEPLOY_USER@$DEPLOY_HOST:/home/kjh2064/tmp/deploy.sh"
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 \
deploy/quantengine.env "$DEPLOY_USER@$DEPLOY_HOST:/home/kjh2064/tmp/quantengine.env"
# 원격 디렉토리 생성
echo "📁 Creating remote directories..."
if ! ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
"$DEPLOY_USER@$DEPLOY_HOST" "mkdir -p /home/kjh2064/tmp"; then
echo "❌ Failed to create remote directories"
notify_failure "Remote directory creation"
fi
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 \
"$DEPLOY_USER@$DEPLOY_HOST" "chmod +x /home/kjh2064/tmp/deploy.sh && CI_DEPLOY=1 /home/kjh2064/tmp/deploy.sh"
# 배포 파일 전송 (재시도)
for file in quantengine.tar.gz:quantengine.tar.gz tools/deploy_quantengine.sh:deploy.sh deploy/quantengine.env:quantengine.env; do
IFS=':' read -r SRC DST <<< "$file"
echo "📤 Transferring $SRC..."
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 \
"$DEPLOY_USER@$DEPLOY_HOST" "mkdir -p /home/kjh2064/.config && install -m 600 /home/kjh2064/tmp/quantengine.env /home/kjh2064/.config/quantengine.env && rm -f /home/kjh2064/tmp/quantengine.env"
for attempt in 1 2 3; do
if scp -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
"$SRC" "$DEPLOY_USER@$DEPLOY_HOST:/home/kjh2064/tmp/$DST" 2>&1; then
echo "✓ Transferred $SRC"
break
elif [ $attempt -lt 3 ]; then
echo " Retry $attempt failed, waiting 5s..."
sleep 5
else
echo "❌ Failed to transfer $SRC after 3 attempts"
notify_failure "File transfer ($SRC)"
fi
done
done
# 배포 스크립트 실행 (재시도)
echo "🚀 Running deployment script..."
for attempt in 1 2; do
if ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
"$DEPLOY_USER@$DEPLOY_HOST" "chmod +x /home/kjh2064/tmp/deploy.sh && CI_DEPLOY=1 /home/kjh2064/tmp/deploy.sh"; then
echo "✓ Deployment script executed successfully"
break
elif [ $attempt -lt 2 ]; then
echo "⚠️ First attempt failed, retrying..."
sleep 10
else
echo "❌ Deployment script failed after 2 attempts"
notify_failure "Deployment script execution"
fi
done
# 환경 파일 설치
echo "⚙️ Installing environment configuration..."
if ! ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
"$DEPLOY_USER@$DEPLOY_HOST" "mkdir -p /home/kjh2064/.config && install -m 600 /home/kjh2064/tmp/quantengine.env /home/kjh2064/.config/quantengine.env && rm -f /home/kjh2064/tmp/quantengine.env"; then
echo "❌ Failed to install configuration"
notify_failure "Configuration installation"
fi
# 서비스 안정화 대기
echo "⏳ Waiting for service stabilization (15s)..."
sleep 15
echo "=== Verifying Loopback Health ==="
loopback_headers=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 "$DEPLOY_USER@$DEPLOY_HOST" "curl -s -D - -o /dev/null http://127.0.0.1:5000/")
echo "$loopback_headers"
if ! printf '%s' "$loopback_headers" | grep -qE '^HTTP/1\.[01] 30[12] '; then
echo "Loopback health check failed for quantengine" >&2
exit 1
loopback_headers=""
for i in 1 2 3; do
echo " Health check attempt $i..."
loopback_headers=$(ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 "$DEPLOY_USER@$DEPLOY_HOST" "curl -s -D - -o /dev/null -m 5 http://127.0.0.1:5000/" 2>&1)
if printf '%s' "$loopback_headers" | grep -qE '^HTTP/1\.[01] (200|30[12]) '; then
echo "✓ Loopback health check passed"
break
elif [ $i -lt 3 ]; then
echo " Waiting 5s for service..."
sleep 5
fi
done
if ! printf '%s' "$loopback_headers" | grep -qE '^HTTP/1\.[01] '; then
echo "❌ Loopback health check failed"
echo "Response: $loopback_headers"
notify_failure "Health check (loopback)"
fi
if ! printf '%s' "$loopback_headers" | grep -qiE '^Location: /login'; then
echo "Loopback redirect target is unexpected" >&2
exit 1
if ! printf '%s' "$loopback_headers" | grep -qiE '(^Location: /login|^HTTP/1\.[01] 200 )'; then
echo "⚠️ Unexpected redirect, but service is responding"
fi
echo "=== Verifying Favicon Assets ==="