File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
66# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
77
8- name : 🚀 개발 서버 배포
8+ name : 🚀 개발 배포
99
1010on :
1111 pull_request :
5151 run : |
5252 mkdir -p before-deploy
5353 cp ./build/libs/*.jar ./before-deploy/
54+ cp ./appspec.yml ./before-deploy/
5455 cp -r ./scripts/dev/ ./before-deploy/scripts/
5556 zip -r deploy.zip before-deploy/
5657
7374 unzip -o /home/ubuntu/deploy.zip -d /home/ubuntu
7475 rm -rf /home/ubuntu/app/*
7576 mv /home/ubuntu/before-deploy/* /home/ubuntu/app/
76-
77- echo "🛑 기존 WAS 종료 시도"
78- PID=$(pgrep -f 'java.*.jar')
79- if [ -n "$PID" ]; then
80- kill -15 "$PID"
81- sleep 5
82- fi
83-
84- echo "🚀 새 WAS 실행"
85- nohup java -jar /home/ubuntu/app/*.jar > /home/ubuntu/app/nohup.out 2>&1 &
86-
87- echo "🩺 Health Check 시작..."
88- for i in {1..10}
89- do
90- HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8080/health-check)
91- if [ "$HTTP_STATUS" -eq 200 ]; then
92- echo "✅ Health Check 성공 (200 OK)"
93- HEALTH_OK=true
94- break
95- fi
96- echo "⏳ 서버 준비 대기 중... 재시도 ($i/10)"
97- sleep 10
98- done
99-
100- if [ "$HEALTH_OK" != true ]; then
101- echo "❌ Health Check 실패"
102- exit 1
103- fi
104-
105- echo "🧹 배포 파일 정리"
106- rm -rf /home/ubuntu/deploy.zip /home/ubuntu/before-deploy
107-
108- exit 0
77+ chmod +x /home/ubuntu/app/scripts/*.sh
78+ /home/ubuntu/app/scripts/run_new_was.sh
79+ rm -rf /home/ubuntu/deploy.zip /home/ubuntu/before-deploy
You can’t perform that action at this time.
0 commit comments