#!/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 &