idea中File-Settings-Plugins
搜索Alibaba Cloud Toolkit点击下载,下载完成重启

1、点击 Tools-Alibaba Cloud-Deploy to Host 部署到主机

2、配置服务器ip、jar包启动命令、服务器jar存放位置

3、设置服务器ip+用户名+密码,点击测试连接情况

4、配置脚本杀jar包进程、配置项目地址以及maven配置 clean install

5、点击运行

6、执行成功之后查看部署环境代码是否成功
杀进程脚本
#!/bin/sh
查找pid
true_pid=`ps -ef | grep java |grep blsframework-cloud-fqwsy.jar | awk '{print $2}'`
判断pid是否存在,存在就杀掉进程
if [[ ${true_pid} != "" ]]
then
echo "pid = $true_pid"
kill -9 $true_pid
else
echo "进程未运行"
fi
sleep 1