File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ BUILD_JAR=$( ls /home/ec2-user/app/build/libs/* .jar)
4+ JAR_NAME=$( basename $BUILD_JAR )
5+ echo " > build 파일명: $JAR_NAME " >> /home/ec2-user/app/deploy.log
6+
7+ echo " > build 파일 복사" >> /home/ec2-user/app/deploy.log
8+ DEPLOY_PATH=/home/ec2-user/app/
9+ cp $BUILD_JAR $DEPLOY_PATH
10+
11+ echo " > 현재 실행중인 애플리케이션 pid 확인" >> /home/ec2-user/app/deploy.log
12+ CURRENT_PID=$( pgrep -f $JAR_NAME )
13+
14+ if [ -z " $CURRENT_PID " ]
15+ then
16+ echo " > 현재 구동중인 애플리케이션이 없으므로 종료하지 않습니다." >> /home/ec2-user/app/deploy.log
17+ else
18+ echo " > 현재 구동중인 애플리케이션 종료: $CURRENT_PID " >> /home/ec2-user/app/deploy.log
19+ kill -15 $CURRENT_PID
20+ sleep 5
21+ fi
22+
23+ DEPLOY_JAR=$DEPLOY_PATH$JAR_NAME
24+ echo " > 애플리케이션 배포: $DEPLOY_JAR " >> /home/ec2-user/app/deploy.log
25+ nohup java -jar $DEPLOY_JAR >> /home/ec2-user/app/deploy.log 2> /home/ec2-user/app/deploy_err.log &
You can’t perform that action at this time.
0 commit comments