记最精简版的启动:gradle集成springboot+vue
- 安装jenkins,安装待推荐插件
- 服务器安装gradle
- 服务器安装npm
- 配置git仓库,配置git开发者账号等
- 配置gradle构建,命令写clean build
- 配置构建后启动命令,启动命令如下所示,当前jar包名字为 server-1.0.jar
- 构建完启动即可
#!/bin/bash echo "Application stop" pid=`ps -ef | grep "server-1.0" | grep -v grep | awk '{print $2}'` if [ -n "$pid" ] then kill -9 $pid fi cd ${WORKSPACE}/server/build/libs/ BUILD_ID=dontKillMe nohup java -jar server-1.0.jar & echo "Application started"
jenkins 默认工作目录
/var/lib/jenkins/workspace/#app#/#appBuildPath# 如 /var/lib/jenkins/workspace/certManage/server/build/libs/