From 59e5e4525f7ebd0e18058c7e062bcc875d47598a Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Mon, 24 Jun 2024 11:31:43 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20=EB=B0=B0=ED=8F=AC=EB=A5=BC=20=EC=9C=84?= =?UTF-8?q?=ED=95=9C=20=EC=89=98=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=20=20=20=20PID=20=EC=83=9D=EC=84=B1=20=20?= =?UTF-8?q?=20=20=20war=20=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 3 ++- shell/backupFo.sh | 3 +++ shell/startFo.sh | 9 +++++++ shell/stopFo.sh | 27 +++++++++++++++++++ .../cokr/xit/adds/XitBootApplication.java | 15 +++++++++-- 5 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 shell/backupFo.sh create mode 100644 shell/startFo.sh create mode 100644 shell/stopFo.sh diff --git a/pom.xml b/pom.xml index c4eee96..c47b948 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,8 @@ install ${basedir}/target - ${project.artifactId}-${project.version} + + ${project.name} ${basedir}/src/main/resources diff --git a/shell/backupFo.sh b/shell/backupFo.sh new file mode 100644 index 0000000..b17e513 --- /dev/null +++ b/shell/backupFo.sh @@ -0,0 +1,3 @@ +#!/bin/sh +source /applications/adds/bin/stopFo.sh +mv /applications/adds/adds-fo.war /applications/adds/adds-fo.war_backup diff --git a/shell/startFo.sh b/shell/startFo.sh new file mode 100644 index 0000000..2d020ee --- /dev/null +++ b/shell/startFo.sh @@ -0,0 +1,9 @@ +#!/bin/bash +echo "======================" +echo "adds-fo application start" +echo "======================" +JAVA_HOME=/lib/jvm/jdk-17.0.2 +export JAVA_HOME +LANG=ko_KR.utf8 +export LANG +sudo nohup $JAVA_HOME/bin/java -Dspring.profiles.active=prod -jar /applications/adds/adds-fo.war > /dev/null & diff --git a/shell/stopFo.sh b/shell/stopFo.sh new file mode 100644 index 0000000..b62e6d6 --- /dev/null +++ b/shell/stopFo.sh @@ -0,0 +1,27 @@ +#!/bin/sh +#if [ $# -ne 1 ]; then +# echo "-----------------------------------" +# echo " Undefined parameter" +# echo "./stopFo.sh [application name]" +# echo "-----------------------------------" +# exit 1 +#fi + +PIDS=`ps -ef | grep java | grep adds-fo | awk '{print $2}'` +for PID in $PIDS; do + echo "Process ID: $PID" +done + +if [ -z "$PIDS" ]; then + echo "==============================" + echo " No adds-fo deamon is running" + echo "==============================" +else + for PID in $PIDS; do + echo "===============================" + echo "Kill adds-fo[$PID] process" + sudo kill -9 $PID + echo "adds-fo[$PID] application stop" + echo "===============================" + done +fi diff --git a/src/main/java/cokr/xit/adds/XitBootApplication.java b/src/main/java/cokr/xit/adds/XitBootApplication.java index 965b295..030eb52 100644 --- a/src/main/java/cokr/xit/adds/XitBootApplication.java +++ b/src/main/java/cokr/xit/adds/XitBootApplication.java @@ -1,11 +1,22 @@ package cokr.xit.adds; +import org.springframework.boot.Banner; import org.springframework.boot.SpringApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.context.ApplicationPidFileWriter; import cokr.xit.base.boot.XitBaseApplication; public class XitBootApplication extends XitBaseApplication { public static void main(String[] args) { - SpringApplication.run(XitBootApplication.class, args); + //SpringApplication.run(XitBootApplication.class, args); + + final SpringApplicationBuilder applicationBuilder = new SpringApplicationBuilder(XitBootApplication.class); + final SpringApplication application = applicationBuilder.build(); + application.setBannerMode(Banner.Mode.OFF); + application.setLogStartupInfo(false); + + application.addListeners(new ApplicationPidFileWriter( "adds-fo.pid")); + application.run(args); } -} \ No newline at end of file +}