You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
727 B
Bash
25 lines
727 B
Bash
3 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
REPOSITORY=/home/ubuntu/xit-framework/bo
|
||
|
cd $REPOSITORY
|
||
|
|
||
|
APP_NAME=xit-framework-bo
|
||
|
WAR_NAME=$(ls $REPOSITORY | grep '.war' | tail -n 1)
|
||
|
WAR_PATH=$REPOSITORY/$WAR_NAME
|
||
|
echo "> war 파일명: $WAR_NAME" >> /home/ubuntu/xit-framework/bo/deploy.log
|
||
|
echo "> war 파일명: $WAR_PATH" >> /home/ubuntu/xit-framework/bo/deploy.log
|
||
|
|
||
|
CURRENT_PID=$(pgrep -f $APP_NAME)
|
||
|
echo "> CURRENT_PID : $CURRENT_PID" >> /home/ubuntu/xit-framework/bo/deploy.log
|
||
|
|
||
|
if [ -z $CURRENT_PID ]
|
||
|
then
|
||
|
echo "> 종료할것 없음."
|
||
|
else
|
||
|
echo "> kill -9 $CURRENT_PID"
|
||
|
kill -9 $CURRENT_PID
|
||
|
sleep 5
|
||
|
fi
|
||
|
rm -rf work/
|
||
|
echo "> $WAR_PATH 배포"
|
||
|
nohup java -jar -Dspring.profiles.active=local $WAR_PATH > /dev/null 2> /dev/null < /dev/null &
|