jenkins常用

记最精简版的启动:gradle集成springboot+vue

  1. 安装jenkins,安装待推荐插件
  2. 服务器安装gradle
  3. 服务器安装npm
  4. 配置git仓库,配置git开发者账号等
  5. 配置gradle构建,命令写clean build
  6. 配置构建后启动命令,启动命令如下所示,当前jar包名字为 server-1.0.jar
  7. 构建完启动即可
#!/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/

  

posted @ 2019-04-13 14:19  小拓同学  阅读(146)  评论(0编辑  收藏  举报