java springboot项目 jar 包linux部署脚本

55 阅读1分钟

#!/bin/bash

#抓取java进程

source /etc/profile

javaid=ps -ef | grep "his-basic" |grep java| grep -v "grep" | awk '{print $2}'

#判断进程当前状态

if [ "$javaid" = "" ];then echo "服务未启动" else echo "停止服务" kill -9 "${javaid}" sleep 6 fi

#将下载的jar包传到发布目录

cp -rf /home/codesrc/his-basic-0.0.1-SNAPSHOT.jar .

#启动basic jar包

nohup java -Xms1400m -Xmx1400m -jar his-basic-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev > basic.log 2>&1 &