diff --git a/shell/README.md b/shell/README.md index ea0a67b..2643157 100644 --- a/shell/README.md +++ b/shell/README.md @@ -8,7 +8,7 @@ > adds-api 서버 stop 및 backup ```shell -$ ./backupApi.sh adds-api +$ ./backupApi.sh ``` ### 2. application upload @@ -24,7 +24,7 @@ $ ./backupApi.sh adds-api > adds-api.jar 파일 업로드 ```shell -$ ./deployApi.sh adds-api +$ ./deployApi.sh ``` ### 4. application run @@ -32,7 +32,7 @@ $ ./deployApi.sh adds-api > adds-api 서버 start ```shell -$ ./startApi.sh adds-api +$ ./startApi.sh ``` ### shell script 실행시 에러 조치 diff --git a/shell/backupApi.sh b/shell/backupApi.sh index e5691e5..b26849f 100644 --- a/shell/backupApi.sh +++ b/shell/backupApi.sh @@ -1,22 +1,22 @@ #!/bin/sh -if [ $# -ne 1 ]; then - echo "-----------------------------------" - echo " Undefined parameter" - echo "./backupApi.sh [application name]" - echo "-----------------------------------" - exit 1 -fi +#if [ $# -ne 1 ]; then +# echo "-----------------------------------" +# echo " Undefined parameter" +# echo "./backupApi.sh [application name]" +# echo "-----------------------------------" +# exit 1 +#fi +# +#if [ ! -f "../$1.jar" ]; then +# echo "===================================" +# echo " $1.jar file not exist" +# echo "===================================" +# exit 1 +#fi -if [ ! -f "../$1.jar" ]; then - echo "===================================" - echo " $1.jar file not exist" - echo "===================================" - exit 1 -fi - -source /applications/adds/bin/stopApi.sh $1 +source /applications/adds/bin/stopApi.sh echo "-----------------------------------" -echo " $1 application backup success!" +echo " adds-api application backup success!" echo "-----------------------------------" -mv /applications/adds/$1.jar /applications/adds/$1.jar_backup +mv /applications/adds/adds-api.jar /applications/adds/adds-api.jar_backup diff --git a/shell/deployApi.sh b/shell/deployApi.sh index 6bcfabe..dbc0f25 100644 --- a/shell/deployApi.sh +++ b/shell/deployApi.sh @@ -14,6 +14,5 @@ if [ ! -f "../$1.jar" ]; then exit 1 fi -source /applications/adds/bin/stopApi.sh $1 mv /applications/adds/$1.jar /applications/adds/$1.jar_backup cp /var/lib/jenkins/workspace/ADDS-API/adds-api/target/$1.jar /applications/adds/$1.jar diff --git a/shell/startApi.sh b/shell/startApi.sh index 637440d..c819d26 100644 --- a/shell/startApi.sh +++ b/shell/startApi.sh @@ -1,23 +1,23 @@ #!/bin/sh -if [ $# -ne 1 ]; then - echo "-----------------------------------" - echo " Undefined parameter" - echo "./startApi.sh [application name]" - echo "-----------------------------------" - exit 1 -fi - -if [ ! -f "../$1.jar" ]; then - echo "===================================" - echo " $1.jar file not exist" - echo "===================================" - exit 1 -fi - +#if [ $# -ne 1 ]; then +# echo "-----------------------------------" +# echo " Undefined parameter" +# echo "./startApi.sh [application name]" +# echo "-----------------------------------" +# exit 1 +#fi +# +#if [ ! -f "../$1.jar" ]; then +# echo "===================================" +# echo " $1.jar file not exist" +# echo "===================================" +# exit 1 +#fi +# echo "================================" -echo " $1 application start" +echo " adds-api application start" echo "================================" JAVA_HOME=/lib/jvm/jdk-17.0.2 export JAVA_HOME -nohup $JAVA_HOME/bin/java -Dspring.profiles.active=prod -jar /applications/adds/$1.jar > /dev/null & +nohup $JAVA_HOME/bin/java -Dspring.profiles.active=prod -jar /applications/adds/adds-api.jar > /dev/null & diff --git a/shell/stopApi.sh b/shell/stopApi.sh index 43b3f0b..efe9f6f 100644 --- a/shell/stopApi.sh +++ b/shell/stopApi.sh @@ -1,22 +1,22 @@ #!/bin/sh -if [ $# -ne 1 ]; then - echo "-----------------------------------" - echo " Undefined parameter" - echo "./stopApi.sh [application name]" - echo "-----------------------------------" - exit 1 -fi +#if [ $# -ne 1 ]; then +# echo "-----------------------------------" +# echo " Undefined parameter" +# echo "./stopApi.sh [application name]" +# echo "-----------------------------------" +# exit 1 +#fi -PID=`ps -ef | grep java | grep $1 | awk '{print $2}'` +PID=`ps -ef | grep java | grep adds-api | awk '{print $2}'` echo "Process ID: $PID" if [ -z $PID ]; then echo "==============================" - echo " No $1 deamon is running" + echo " No adds-api deamon is running" echo "==============================" else - echo "Kill $1[$PID] process" + echo "Kill adds-api[$PID] process" kill $PID echo "===============================" - echo " $1[$PID] application stop" + echo " adds-api[$PID] application stop" echo "===============================" fi diff --git a/src/main/java/cokr/xit/adds/XitAddsApplication.java b/src/main/java/cokr/xit/adds/XitAddsApplication.java index a5587a3..0ac9caa 100644 --- a/src/main/java/cokr/xit/adds/XitAddsApplication.java +++ b/src/main/java/cokr/xit/adds/XitAddsApplication.java @@ -37,7 +37,6 @@ import lombok.extern.slf4j.Slf4j; TransactionConfig.class }) public class XitAddsApplication { - static final List basePackages = new ArrayList<>( Arrays.asList("egovframework", "kr.xit") ); @@ -70,7 +69,7 @@ public class XitAddsApplication { //TODO : 이벤트 실행 시점이 Application context 실행 이전인 경우 리스너 추가 //PID(Process ID 작성) - application.addListeners(new ApplicationPidFileWriter()) ; + application.addListeners(new ApplicationPidFileWriter("adds-api.pid")); application.run(args); log.info("=========================================================================================");