File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 integration-test :
1616 runs-on : ubuntu-latest
1717
18-
1918 steps :
2019 - name : Checkout code
2120 uses : actions/checkout@v4
3231 pip install -r requirements.txt
3332 pip install pytest pytest-cov pytest-asyncio httpx
3433
35-
3634 - name : Upload coverage reports
3735 uses : codecov/codecov-action@v4
3836 with :
@@ -63,16 +61,22 @@ jobs:
6361 ssh -o StrictHostKeyChecking=no -i private_key.pem ${USER}@${HOST} << 'EOF'
6462 set -e
6563
64+ # 가상환경 경로 설정
65+ VENV_PATH="/home/ubuntu/app/venv"
66+ APP_PATH="/home/ubuntu/app"
67+
6668 echo "📦 Pulling latest code..."
67- cd /home/ubuntu/app
69+ cd ${APP_PATH}
6870 git pull origin main
6971
70- echo "🔧 Installing dependencies..."
71- source venv/bin/activate
72- pip install -r requirements.txt
72+ echo "🔧 Installing dependencies in virtual environment..."
73+ # 가상환경의 pip을 직접 실행
74+ ${VENV_PATH}/bin/pip install --upgrade pip
75+ ${VENV_PATH}/bin/pip install -r requirements.txt
7376
7477 echo "🧪 Running health check..."
75- python -c "from app.main import app; print('✅ App imports successfully')"
78+ # 가상환경의 python을 직접 실행
79+ ${VENV_PATH}/bin/python -c "from app.main import app; print('✅ App imports successfully')"
7680
7781 echo "🔄 Restarting service..."
7882 sudo systemctl restart myapp
8791 EOF
8892
8993 rm -f private_key.pem
90-
91-
9294
9395 - name : Verify deployment
9496 env :
@@ -101,5 +103,4 @@ jobs:
101103 else
102104 echo "❌ Health check failed with status: $response"
103105 exit 1
104- fi
105-
106+ fi
You can’t perform that action at this time.
0 commit comments