File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 3333 host : ${{ secrets.EC2_HOST }}
3434 username : ${{ secrets.EC2_USER }}
3535 key : ${{ secrets.EC2_SSH_KEY }}
36- source : " build/libs/*.jar"
37- target : " /home/ubuntu/app/app.jar "
36+ source : " build/libs/*-SNAPSHOT .jar"
37+ target : " /home/ubuntu/app"
3838 overwrite : true
3939
4040 # 5) EC2에서 앱 재시작
@@ -46,10 +46,18 @@ jobs:
4646 key : ${{ secrets.EC2_SSH_KEY }}
4747 script : |
4848 cd /home/ubuntu/app
49-
50- pkill -f "java -jar app.jar " || true
49+
50+ pkill -f "java -jar" || true
5151 sleep 5
5252
53+ JAR_PATH=$(ls -t build/libs/*-SNAPSHOT.jar | head -n 1)
54+ echo "Using JAR: $JAR_PATH"
55+
56+ if [ -z "$JAR_PATH" ]; then
57+ echo "No JAR found under build/libs"
58+ exit 1
59+ fi
60+
5361 export DB_PASSWORD='${{ secrets.DB_PASSWORD }}'
54-
55- nohup java -jar app.jar > app.log 2>&1 &
62+
63+ nohup java -jar "$JAR_PATH" > app.log 2>&1 &
You can’t perform that action at this time.
0 commit comments