From 24e47e09ff6d2218e0e7033612beb8d3e760015c Mon Sep 17 00:00:00 2001 From: limju Date: Wed, 18 Oct 2023 14:34:27 +0900 Subject: [PATCH] build: shell script add --- .../main/resources/config/application-prod.yml | 16 ++++++++-------- shell/backupApi.sh | 9 +++++++-- shell/startApi.sh | 2 +- shell/stopApi.sh | 14 ++++++++------ 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/mens-api/src/main/resources/config/application-prod.yml b/mens-api/src/main/resources/config/application-prod.yml index f44ce08..ec4f889 100644 --- a/mens-api/src/main/resources/config/application-prod.yml +++ b/mens-api/src/main/resources/config/application-prod.yml @@ -4,13 +4,13 @@ spring: datasource: hikari: - # 9 server - maria: - driver-class-name: org.mariadb.jdbc.Driver - jdbc-url: jdbc:mariadb://211.119.124.9:4407/mens?useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&autoReconnect=true - username: root - password: xit1807 - read-only: false + # 9 server + maria: + driver-class-name: org.mariadb.jdbc.Driver + jdbc-url: jdbc:mariadb://211.119.124.8:4407/mens?useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&autoReconnect=true + username: root + password: xit1807 + read-only: false devtools: livereload: @@ -52,7 +52,7 @@ decorator: app: # swagger url - url: 'http://localhost:${server.port}${server.servlet.context-path:}/' + url: 'http://211.119.124.8:${server.port}${server.servlet.context-path:}/' data: root: path: /data diff --git a/shell/backupApi.sh b/shell/backupApi.sh index 944de25..01e4384 100644 --- a/shell/backupApi.sh +++ b/shell/backupApi.sh @@ -13,5 +13,10 @@ if [ ! -f "$1.jar" ]; then echo "===================================" exit 1 fi -mv /applications/mens/$1.jar /applications/mens/$1.jar_backup -#cp /var/lib/jenkins/workspace/MENS-API/mens-api/target/mens-api.jar /applications/mens/ens-api.jar + +source /applications/mens/stopApi.sh $1 + +echo "-----------------------------------" +echo " $1 application backup success!" +echo "-----------------------------------" +#mv /applications/mens/$1.jar /applications/mens/$1.jar_backup diff --git a/shell/startApi.sh b/shell/startApi.sh index c5d72d0..56e2010 100644 --- a/shell/startApi.sh +++ b/shell/startApi.sh @@ -15,7 +15,7 @@ if [ ! -f "$1.jar" ]; then fi echo "================================" -echo " $1 deamon start" +echo " $1 application start" echo "================================" JAVA_HOME=/lib/jvm/java-17-openjdk export JAVA_HOME diff --git a/shell/stopApi.sh b/shell/stopApi.sh index a81d57e..43b3f0b 100644 --- a/shell/stopApi.sh +++ b/shell/stopApi.sh @@ -7,14 +7,16 @@ if [ $# -ne 1 ]; then exit 1 fi -PID=`ps -ef | grep java | grep $1- | awk '{print $2}'` +PID=`ps -ef | grep java | grep $1 | awk '{print $2}'` echo "Process ID: $PID" if [ -z $PID ]; then - echo "No process is running" + echo "==============================" + echo " No $1 deamon is running" + echo "==============================" else - echo "Kill process" + echo "Kill $1[$PID] process" kill $PID - echo "=========================" - echo "mens-api deamon stop" - echo "=========================" + echo "===============================" + echo " $1[$PID] application stop" + echo "===============================" fi