Commit 2f606cd6 authored by 赵啸非's avatar 赵啸非

修改添加部署文件

parent 8fa4f312
...@@ -66,6 +66,26 @@ ...@@ -66,6 +66,26 @@
<profiles.log.path>/mortals/app/logs</profiles.log.path> <profiles.log.path>/mortals/app/logs</profiles.log.path>
</properties> </properties>
</profile> </profile>
<profile>
<id>yibin</id>
<properties>
<profiles.active>yibin</profiles.active>
<profiles.server.port>17217</profiles.server.port>
<profiles.queue.type>rabbitmq</profiles.queue.type>
<profiles.rabbitmq.host>172.15.28.115</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.filepath>/mortals/app/data</profiles.filepath>
<profiles.log.level>INFO</profiles.log.level>
</properties>
</profile>
</profiles> </profiles>
<dependencies> <dependencies>
......
#!/bin/bash
PORT="@profiles.server.port@"
PROJECT_NAME="@project.artifactId@";
MAIN_CLASS="$PROJECT_NAME-@project.version@.jar";
SHELL_NAME=$0
SHELL_LOG="${SHELL_NAME}.log"
LOG_DATE='date "+%Y-%m-%d"'
LOG_TIME='date "+%H-%M-%S"'
CDATE=$(date "+%Y-%m-%d")
CTIME=$(date "+%H-%M-%S")
#写日志
writelog() {
LOGINFO=$1
echo "${CDATE} ${CTIME}: ${SHELL_NAME} : ${LOGINFO}" >>${SHELL_LOG}
}
jcpid=`ps -ef | grep -v "grep" | grep "$MAIN_CLASS" | grep "app.port=$PORT" | sed -n '1P' | awk '{print $2}'`
if [ $jcpid ]; then
writelog "The $PROJECT_NAME start finished, PID is $jcpid"
exit $SUCCESS
else
writelog "start service..."
systemctl stop ${PROJECT_NAME} && systemctl start ${PROJECT_NAME}
fi
#! /bin/sh #! /bin/sh
PORT="@profiles.server.port@" PORT="@profiles.server.port@"
BASEDIR=`dirname $0` BASEDIR=$(dirname $0)
BASEDIR=`(cd "$BASEDIR"; pwd)` BASEDIR=$( (
cd "$BASEDIR"
pwd
))
PROJECT_NAME="@project.artifactId@" PROJECT_NAME="@project.artifactId@"
MAIN_CLASS="$PROJECT_NAME"; MAIN_CLASS="$PROJECT_NAME"
if [ ! -n "$PORT" ]; then if [ ! -n "$PORT" ]; then
echo $"Usage: $0 {port}" echo $"Usage: $0 {port}"
exit $FAIL exit $FAIL
fi fi
pid=$(ps ax | grep -i "$MAIN_CLASS" | grep java | grep -v grep | awk '{print $1}')
pid=`ps ax | grep -i "$MAIN_CLASS" | grep java | grep -v grep | awk '{print $1}'` if [ -z "$pid" ]; then
if [ -z "$pid" ] ; then
echo "No Server running." echo "No Server running."
exit -1; exit 1
fi fi
echo "stoping application $PROJECT_NAME......" echo "stoping application $PROJECT_NAME......"
kill -9 ${pid} kill -15 ${pid}
echo "Send shutdown request to Server $PROJECT_NAME OK" echo "Send shutdown request to Server $PROJECT_NAME OK"
...@@ -5,9 +5,9 @@ BASEDIR=`(cd "$BASEDIR"; pwd)` ...@@ -5,9 +5,9 @@ BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="@project.artifactId@"; PROJECT_NAME="@project.artifactId@";
MAIN_CLASS="$PROJECT_NAME-@project.version@.jar"; MAIN_CLASS="$PROJECT_NAME-@project.version@.jar";
LOG_PATH="@profiles.log.path@/$PROJECT_NAME" LOG_PATH="@profiles.log.path@/$PROJECT_NAME"
GC_PATH=$LOG_PATH/$PORT"-gc.log" GC_PATH=$LOG_PATH/PROJECT_NAME"-gc.log"
HS_ERR_PATH=$LOG_PATH/$PORT"-hs_err.log" HS_ERR_PATH=$LOG_PATH/PROJECT_NAME"-hs_err.log"
HEAP_DUMP_PATH=$LOG_PATH/$PORT"-heap_dump.hprof" HEAP_DUMP_PATH=$LOG_PATH/PROJECT_NAME"-heap_dump.hprof"
TEMP_PATH=$LOG_PATH/temp/ TEMP_PATH=$LOG_PATH/temp/
SUCCESS=0 SUCCESS=0
FAIL=9 FAIL=9
...@@ -32,9 +32,8 @@ if [ -z "$JAVACMD" ] ; then ...@@ -32,9 +32,8 @@ if [ -z "$JAVACMD" ] ; then
JAVACMD="$JAVA_HOME/bin/java" JAVACMD="$JAVA_HOME/bin/java"
fi fi
else else
JAVACMD=`which java > /dev/null 2>&1` JAVACMD=`which java`
echo "Error: JAVA_HOME is not defined correctly." echo "Error: JAVA_HOME is $JAVACMD"
exit $ERR_NO_JAVA
fi fi
fi fi
...@@ -60,7 +59,8 @@ exec "$JAVACMD" $JAVA_OPTS \ ...@@ -60,7 +59,8 @@ exec "$JAVACMD" $JAVA_OPTS \
-Dapp.port="$PORT" \ -Dapp.port="$PORT" \
-Dbasedir="$BASEDIR" \ -Dbasedir="$BASEDIR" \
-Djava.io.tmpdir=$TEMP_PATH \ -Djava.io.tmpdir=$TEMP_PATH \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=15502 \ -Dloader.path="file://$BASEDIR/conf,file://$BASEDIR/lib" \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5616 \
-jar $MAIN_CLASS \ -jar $MAIN_CLASS \
> /dev/null & > /dev/null &
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment