springboot jekins打包

新建Item

选择freestyle

配置下拉框

This project is parameterized

配置git

构建shell脚本

脚本

shell 复制代码
BUILD_ID=DONTKILLME
. /etc/profile
export PROJ_PATH=`pwd`
export TOMCAT_APP_PATH=/root/local/apache-tomcat-8.5.45
export BASE_PATH=/root/local

echo $PROJ_PATH
echo $TOMCAT_APP_PATH
echo $BASE_PATH


if [ "$project" = "wx-mp" ]
then

pid2=`ps -ef | grep mp-demo-8080.jar | grep -v grep | awk '{print $2}'`
echo $pid2

    if [ -n "$pid2" ]
    then
    kill -9 $pid2
    fi
    
    cd $PROJ_PATH/wx-study/$project/
    mvn clean package -DskipTests

    rm -rf $BASE_PATH/mp-demo-8080.jar
    cd target/
    cp mp-demo-8080.jar $BASE_PATH/
    cd $BASE_PATH 
    nohup java -jar -Xms256m -Xmx256m mp-demo-8080.jar >mp-demo.out & 
    echo "wx-mp启动成功"
fi
相关推荐
devilnumber21 小时前
Java 递归算法 详解 + 核心要点 + 实战运用 + 避坑指南
java·开发语言·算法
独泪了无痕1 天前
MyBatis魔法堂:结果集映射
后端·mybatis
copyer_xyf1 天前
LangChain 调用 LLM
后端·python·agent
copyer_xyf1 天前
Prompt 组织管理
后端·python·agent
asdfg12589631 天前
JavaBean是什么?怎么理解?有什么用途?
java·开发语言
摇滚侠1 天前
SpringMVC 入门到实战 文件上传 75-77
java·后端·spring·maven·intellij-idea
GIS数据转换器1 天前
城市排水生命线安全运行监测平台深度解析
java·运维·人工智能·python·安全·数据挖掘·无人机
华如锦1 天前
面了很多 Java转AI Agent方向,一些面试题总结
java·开发语言·人工智能·python·ai
睡不醒男孩0308231 天前
CLup 6.x 版本中针对StarRocks 存算一体集群的完整操作手册
java·服务器·网络·clup
程序员黑豆1 天前
Java中怎么实现字符串拼接呢【AI全栈开发】
java