单体应用快速部署的技巧

前提

将sh.exe放到windows系统的环境变量中。

上传

uploadJar4win.cmd

sh uploadJar.sh
pause

uploadJar.sh

scp ../target/*.jar bkd@8.8.8.8:/home/bkd/deploy/project/

部署

deploy4win.cmd

sh deploy.sh
pause

deploy.sh

ssh bkd@8.134.64.69 “cd /home/bkd/deploy/pyqt5 ; ls -lh ; ./restart.sh”

服务运维脚本

ps.sh

#!/bin/sh
ps aux|grep java

stop.sh

#!/bin/sh
ps aux|grep ruoyi|grep -v grep
ps -ef | grep ruoyi | grep -v grep | cut -c 9-16 | xargs kill -9

run.sh

java -jar -Xbootclasspath/a:./config -Dlogging.config=./config/logback-spring.xml -Dloader.path=lib -Dfile.encoding=utf-8 pyqt5.jar

restart.sh

#!/bin/sh
ps aux|grep ruoyi|grep -v grep
ps -ef | grep ruoyi | grep -v grep | cut -c 9-16 | xargs kill -9
nohup ./run.sh &
sleep 1
ps aux|grep ruoyi|grep -v grep

Author: bkdwei