fix: Remove UTF-8 emojis and Korean comments from workflows (Gitea parser compatibility)
Merge to Main - Full Pipeline / Stage 1: Fast Gates (push) Failing after 4s
Merge to Main - Full Pipeline / Stage 2: Critical Gates (push) Has been skipped
Merge to Main - Full Pipeline / Stage 3: Integration Tests (push) Has been skipped
Merge to Main - Full Pipeline / Stage 4: Build and Package (push) Has been skipped
Merge to Main - Full Pipeline / Stage 5: Trigger Deploy Pipeline (push) Has been skipped
Merge to Main - Full Pipeline / Pipeline Summary (push) Successful in 1s
Merge to Main - Full Pipeline / Stage 1: Fast Gates (push) Failing after 4s
Merge to Main - Full Pipeline / Stage 2: Critical Gates (push) Has been skipped
Merge to Main - Full Pipeline / Stage 3: Integration Tests (push) Has been skipped
Merge to Main - Full Pipeline / Stage 4: Build and Package (push) Has been skipped
Merge to Main - Full Pipeline / Stage 5: Trigger Deploy Pipeline (push) Has been skipped
Merge to Main - Full Pipeline / Pipeline Summary (push) Successful in 1s
This commit is contained in:
@@ -55,10 +55,10 @@ jobs:
|
||||
|
||||
- name: "[GATE] Run Core Validations"
|
||||
run: |
|
||||
echo "🔐 Running critical CI validations..."
|
||||
echo " Running critical CI validations..."
|
||||
python3 tools/validate_no_direct_api_trading_v1.py || exit 1
|
||||
python3 tools/validate_specs.py || exit 1
|
||||
echo "✅ All critical validations passed"
|
||||
echo " All critical validations passed"
|
||||
|
||||
- name: Ensure Temp Directory and Mock Packet
|
||||
run: |
|
||||
@@ -95,25 +95,25 @@ jobs:
|
||||
BUILD_TIME=$(date -d "+9 hours" +'%Y-%m-%d %H:%M:%S KST')
|
||||
mkdir -p ./publish/wwwroot
|
||||
printf '{\n "version": "1.0.%s-%s",\n "built": "%s"\n}\n' "${{ github.run_number }}" "$COMMIT_HASH" "$BUILD_TIME" > ./publish/wwwroot/version.json
|
||||
echo "✓ Generated version info: 1.0.${{ github.run_number }}-$COMMIT_HASH @ $BUILD_TIME"
|
||||
echo " Generated version info: 1.0.${{ github.run_number }}-$COMMIT_HASH @ $BUILD_TIME"
|
||||
|
||||
- name: Prepare & Validate QuantEngine DB Env
|
||||
run: |
|
||||
echo "🔧 Preparing database environment..."
|
||||
echo " Preparing database environment..."
|
||||
|
||||
DB_PASSWORD="${{ secrets.QUANTENGINE_DB_PASSWORD }}"
|
||||
if [ -z "$DB_PASSWORD" ]; then
|
||||
echo "❌ QUANTENGINE_DB_PASSWORD secret not configured in Gitea"
|
||||
echo " QUANTENGINE_DB_PASSWORD secret not configured in Gitea"
|
||||
echo " Please set secret in Repository Settings > Secrets"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${{ env.QUANTENGINE_DB_NAME }}" ] || [ -z "${{ env.QUANTENGINE_DB_USER }}" ]; then
|
||||
echo "❌ DB configuration environment variables not set"
|
||||
echo " DB configuration environment variables not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 배포 폴더에 환경 설정 생성
|
||||
#
|
||||
mkdir -p ./deploy
|
||||
printf 'ConnectionStrings__DefaultConnection=Host=127.0.0.1;Database=%s;Username=%s;Password=%s;Search Path=quantengine;\n' \
|
||||
"${{ env.QUANTENGINE_DB_NAME }}" \
|
||||
@@ -121,7 +121,7 @@ jobs:
|
||||
"$DB_PASSWORD" > ./deploy/quantengine.env
|
||||
chmod 600 ./deploy/quantengine.env
|
||||
|
||||
# appsettings.Production.json 생성
|
||||
# appsettings.Production.json
|
||||
mkdir -p ./publish
|
||||
cat <<EOF > ./publish/appsettings.Production.json
|
||||
{
|
||||
@@ -133,27 +133,27 @@ jobs:
|
||||
chmod 600 ./publish/appsettings.Production.json
|
||||
|
||||
if [ ! -f ./deploy/quantengine.env ] || [ ! -f ./publish/appsettings.Production.json ]; then
|
||||
echo "❌ Failed to create database config files"
|
||||
echo " Failed to create database config files"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✓ Database configuration prepared"
|
||||
echo " Database configuration prepared"
|
||||
|
||||
- name: Copy Deployment Scripts
|
||||
run: |
|
||||
echo "📋 Copying deployment scripts..."
|
||||
echo "ð Copying deployment scripts..."
|
||||
cp deploy_gb.sh ./publish/deploy_gb.sh
|
||||
mkdir -p ./publish/scripts
|
||||
cp scripts/validate_migrations.sh ./publish/scripts/validate_migrations.sh
|
||||
chmod +x ./publish/deploy_gb.sh ./publish/scripts/validate_migrations.sh
|
||||
echo "✓ Deployment scripts copied"
|
||||
echo " Deployment scripts copied"
|
||||
|
||||
- name: Package Artifact
|
||||
run: |
|
||||
echo "📦 Creating deployment package..."
|
||||
echo " Creating deployment package..."
|
||||
|
||||
if ! tar -czf quantengine.tar.gz -C ./publish .; then
|
||||
echo "❌ Failed to create package"
|
||||
echo " Failed to create package"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -161,45 +161,45 @@ jobs:
|
||||
PACKAGE_BYTES=$(stat -c%s quantengine.tar.gz 2>/dev/null || echo "0")
|
||||
|
||||
if [ -z "$PACKAGE_BYTES" ] || [ "$PACKAGE_BYTES" -lt 1000000 ]; then
|
||||
echo "⚠️ Warning: Package seems too small ($PACKAGE_SIZE)"
|
||||
echo " Warning: Package seems too small ($PACKAGE_SIZE)"
|
||||
fi
|
||||
|
||||
if [ ! -f quantengine.tar.gz ]; then
|
||||
echo "❌ Package file not created"
|
||||
echo " Package file not created"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✓ Package created: $PACKAGE_SIZE"
|
||||
echo " Package created: $PACKAGE_SIZE"
|
||||
tar -tzf quantengine.tar.gz | head -n 5 || true
|
||||
|
||||
- name: Pre-Deployment Migration Validation
|
||||
run: |
|
||||
echo "=== Pre-Deployment Database Check ==="
|
||||
|
||||
# 배포 패키지 임시 추출 (검증용)
|
||||
# ()
|
||||
TEMP_DEPLOY="/tmp/quantengine_validate"
|
||||
mkdir -p "$TEMP_DEPLOY"
|
||||
tar -xzf quantengine.tar.gz -C "$TEMP_DEPLOY"
|
||||
|
||||
# 마이그레이션 검증 실행
|
||||
#
|
||||
chmod +x "$TEMP_DEPLOY/scripts/validate_migrations.sh"
|
||||
"$TEMP_DEPLOY/scripts/validate_migrations.sh" "$TEMP_DEPLOY"
|
||||
|
||||
# 정리
|
||||
#
|
||||
rm -rf "$TEMP_DEPLOY"
|
||||
|
||||
- name: Pre-Deployment Verification
|
||||
run: |
|
||||
echo "=== PRE-DEPLOYMENT CHECKS ==="
|
||||
|
||||
# 1. SSH 키 검증
|
||||
# 1. SSH
|
||||
if [ ! -f ~/.ssh/id_rsa ]; then
|
||||
echo "ERROR: SSH key not found"
|
||||
exit 1
|
||||
fi
|
||||
echo "OK: SSH key present"
|
||||
|
||||
# 2. 배포 패키지 검증
|
||||
# 2.
|
||||
if [ ! -f quantengine.tar.gz ]; then
|
||||
echo "ERROR: Build artifact (quantengine.tar.gz) not found"
|
||||
exit 1
|
||||
@@ -210,7 +210,7 @@ jobs:
|
||||
fi
|
||||
echo "OK: Build artifact present (${ARTIFACT_SIZE} bytes)"
|
||||
|
||||
# 3. 필수 파일 검증
|
||||
# 3.
|
||||
for file in deploy/quantengine.env deploy_gb.sh; do
|
||||
if [ ! -f "$file" ]; then
|
||||
echo "ERROR: Required file missing: $file"
|
||||
@@ -219,7 +219,7 @@ jobs:
|
||||
done
|
||||
echo "OK: All required deployment files present"
|
||||
|
||||
# 4. 환경 변수 검증
|
||||
# 4.
|
||||
if [ -z "${{ secrets.QUANTENGINE_DB_PASSWORD }}" ]; then
|
||||
echo "ERROR: DB password secret not configured"
|
||||
exit 1
|
||||
@@ -233,7 +233,7 @@ jobs:
|
||||
run: |
|
||||
set -e
|
||||
|
||||
# 변수 설정
|
||||
#
|
||||
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
||||
COMMIT=$(git rev-parse --short HEAD)
|
||||
RUN_NUM="${{ github.run_number }}"
|
||||
@@ -269,14 +269,14 @@ jobs:
|
||||
echo "Target: $TARGET_DIR"
|
||||
echo ""
|
||||
|
||||
# 배포 디렉토리 생성
|
||||
#
|
||||
echo "[1/8] Creating deployment directories..."
|
||||
mkdir -p "${DEPLOY_BASE}" || { echo "FATAL: Cannot create deploy base"; exit 1; }
|
||||
mkdir -p "${TARGET_DIR}" || { echo "FATAL: Cannot create target dir"; exit 1; }
|
||||
echo "OK: Directories created"
|
||||
echo ""
|
||||
|
||||
# 배포 패키지 추출
|
||||
#
|
||||
echo "[2/8] Extracting build artifact..."
|
||||
if ! tar -xzf quantengine.tar.gz -C "${TARGET_DIR}"; then
|
||||
echo "FATAL: Failed to extract artifact"
|
||||
@@ -286,7 +286,7 @@ jobs:
|
||||
ls "${TARGET_DIR}" | head -10
|
||||
echo ""
|
||||
|
||||
# 배포 구조 정규화
|
||||
#
|
||||
echo "[3/8] Normalizing deployment structure..."
|
||||
if [ -d "${TARGET_DIR}/net10.0" ]; then
|
||||
echo "Found net10.0 subdirectory, moving to root..."
|
||||
@@ -300,7 +300,7 @@ jobs:
|
||||
echo "OK: Structure normalized"
|
||||
echo ""
|
||||
|
||||
# 필수 파일 검증
|
||||
#
|
||||
echo "[4/8] Validating deployment contents..."
|
||||
if [ ! -f "${TARGET_DIR}/QuantEngine.Web.dll" ]; then
|
||||
echo "FATAL: QuantEngine.Web.dll not found in deployment"
|
||||
@@ -313,14 +313,14 @@ jobs:
|
||||
echo "OK: All required files present"
|
||||
echo ""
|
||||
|
||||
# 환경 파일 설치
|
||||
#
|
||||
echo "[5/8] Installing environment configuration..."
|
||||
mkdir -p /home/kjh2064/.config || { echo "WARNING: Cannot create config dir"; }
|
||||
install -m 600 ./deploy/quantengine.env /home/kjh2064/.config/quantengine.env || { echo "WARNING: Config file install failed"; }
|
||||
echo "OK: Configuration installed"
|
||||
echo ""
|
||||
|
||||
# appsettings.Production.json 생성
|
||||
# appsettings.Production.json
|
||||
echo "[6/8] Creating production appsettings..."
|
||||
mkdir -p "${TARGET_DIR}"
|
||||
DB_PASSWORD="${{ secrets.QUANTENGINE_DB_PASSWORD }}"
|
||||
@@ -352,7 +352,7 @@ EOF
|
||||
echo "commit=${COMMIT}" >> $GITHUB_OUTPUT
|
||||
echo "target_dir=${TARGET_DIR}" >> $GITHUB_OUTPUT
|
||||
|
||||
# 이전 버전 저장 (롤백용)
|
||||
# ()
|
||||
PREV_VERSION="none"
|
||||
if [ -L "${ACTIVE_LINK}" ]; then
|
||||
PREV_VERSION=$(readlink -f "${ACTIVE_LINK}")
|
||||
@@ -373,7 +373,7 @@ EOF
|
||||
|
||||
echo "OK: Green-Blue deployment completed"
|
||||
|
||||
# 배포 정보 저장
|
||||
#
|
||||
cat > "${TARGET_DIR}/.deployment_info" << EOF
|
||||
Deployed: $(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
Commit: ${COMMIT}
|
||||
@@ -413,7 +413,7 @@ EOF
|
||||
|
||||
echo "=== POST-DEPLOYMENT HEALTH CHECKS ==="
|
||||
|
||||
# 1. 배포 디렉토리 검증
|
||||
# 1.
|
||||
echo "[1/4] Verifying deployment directory..."
|
||||
if [ ! -d "$TARGET_DIR" ]; then
|
||||
echo "FATAL: Deployment directory not found: $TARGET_DIR"
|
||||
@@ -425,7 +425,7 @@ EOF
|
||||
fi
|
||||
echo "OK: Deployment directory verified"
|
||||
|
||||
# 2. Loopback 헬스 체크
|
||||
# 2. Loopback
|
||||
echo "[2/4] Performing loopback health checks..."
|
||||
health_check_passed=0
|
||||
for i in $(seq 1 ${{ env.HEALTH_CHECK_RETRIES }}); do
|
||||
@@ -447,7 +447,7 @@ EOF
|
||||
fi
|
||||
echo "OK: Loopback health check passed"
|
||||
|
||||
# 3. 데이터베이스 연결 검증
|
||||
# 3.
|
||||
echo "[3/4] Verifying database connectivity..."
|
||||
if timeout 10 bash -c 'cat /home/kjh2064/.config/quantengine.env | grep -q "postgresql"' 2>/dev/null; then
|
||||
echo "OK: Database credentials configured"
|
||||
@@ -455,7 +455,7 @@ EOF
|
||||
echo "WARNING: Could not verify database credentials"
|
||||
fi
|
||||
|
||||
# 4. 서비스 상태 확인
|
||||
# 4.
|
||||
echo "[4/4] Checking service status..."
|
||||
if systemctl is-active --quiet quantengine; then
|
||||
echo "OK: Service is running"
|
||||
@@ -516,9 +516,9 @@ EOF
|
||||
db_status=$(psql -U quantengine_app -d quantenginedb -h 127.0.0.1 -c 'SELECT 1;' 2>&1 | head -1)
|
||||
|
||||
if echo "$db_status" | grep -q "1"; then
|
||||
echo "✓ Database connectivity verified"
|
||||
echo " Database connectivity verified"
|
||||
else
|
||||
echo "⚠️ Database connectivity check: $db_status"
|
||||
echo " Database connectivity check: $db_status"
|
||||
fi
|
||||
|
||||
- name: Post-Deployment Verification
|
||||
@@ -526,7 +526,7 @@ EOF
|
||||
run: |
|
||||
echo "=== POST-DEPLOYMENT VERIFICATION ==="
|
||||
|
||||
# Public endpoints 검증
|
||||
# Public endpoints
|
||||
echo "[1/3] Verifying public endpoints..."
|
||||
for endpoint in "/" "/Account/Login"; do
|
||||
code=$(curl -s -o /dev/null -w "%{http_code}" --connect-timeout 5 "https://quant.taxbaik.com${endpoint}")
|
||||
@@ -536,7 +536,7 @@ EOF
|
||||
fi
|
||||
done
|
||||
|
||||
# Nginx 설정 검증
|
||||
# Nginx
|
||||
echo "[2/3] Verifying Nginx configuration..."
|
||||
if nginx -t 2>&1 | grep -q "successful"; then
|
||||
echo " OK: Nginx syntax valid"
|
||||
@@ -544,7 +544,7 @@ EOF
|
||||
echo " WARNING: Nginx validation may have issues"
|
||||
fi
|
||||
|
||||
# 배포 기록 생성
|
||||
#
|
||||
echo "[3/3] Creating deployment record..."
|
||||
DEPLOYMENT_SUMMARY="deployment_summary_${{ steps.deploy.outputs.timestamp }}.txt"
|
||||
cat > "$DEPLOYMENT_SUMMARY" << EOF
|
||||
@@ -640,5 +640,5 @@ Logs: https://gitea.taxbaik.com/kjh2064/QuantEngineByItz/actions/runs/${{ github
|
||||
|
||||
curl -fsS -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
|
||||
-d "chat_id=${TELEGRAM_CHAT_ID}" \
|
||||
--data-urlencode "text=❌ QuantEngine 배포 실패\n커밋: ${COMMIT}\n로그: https://gitea.taxbaik.com/kjh2064/QuantEngineByItz/actions/runs/${{ github.run_id }}" \
|
||||
--data-urlencode "text= QuantEngine \n: ${COMMIT}\n: https://gitea.taxbaik.com/kjh2064/QuantEngineByItz/actions/runs/${{ github.run_id }}" \
|
||||
-d "parse_mode=HTML" || true
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
|
||||
- name: Report Tier 1
|
||||
if: success()
|
||||
run: echo "✓ Tier 1 (Fast Gates) passed"
|
||||
run: echo " Tier 1 (Fast Gates) passed"
|
||||
|
||||
stage-2-critical-gates:
|
||||
name: "Stage 2: Critical Gates"
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
- name: Report Tier 2
|
||||
if: success()
|
||||
run: echo "✓ Tier 2 (Critical Gates) passed"
|
||||
run: echo " Tier 2 (Critical Gates) passed"
|
||||
|
||||
stage-3-validators-parallel:
|
||||
name: "Stage 3: Integration Tests"
|
||||
@@ -99,7 +99,7 @@ jobs:
|
||||
|
||||
- name: Report Tier 3
|
||||
if: always()
|
||||
run: echo "✓ Tier 3 (Integration Tests) completed"
|
||||
run: echo " Tier 3 (Integration Tests) completed"
|
||||
|
||||
stage-4-build:
|
||||
name: "Stage 4: Build and Package"
|
||||
@@ -162,7 +162,7 @@ jobs:
|
||||
|
||||
- name: Report Tier 4
|
||||
if: success()
|
||||
run: echo "✓ Tier 4 (Build) succeeded"
|
||||
run: echo " Tier 4 (Build) succeeded"
|
||||
|
||||
stage-5-deploy:
|
||||
name: "Stage 5: Trigger Deploy Pipeline"
|
||||
|
||||
Reference in New Issue
Block a user