jenkins安装
请参考linux部署这篇博客
安装github插件
- 登录jenkins管理后台 选中左边菜单系统管理 管理插件
- 选中可选插件 过滤github 选中插件 直接安装
全局工具配置(Global Tool Configuratio)
- jdk配置 别名: jdk名称 JAVA_HOME: jdk路径
- maven配置 Name: maven名称 MAVEN_HOME: maven路径
创建任务
- 选中General下的[Github project]
- Project url: https://github.com/ysm20140508/fundCrawLer/
- 选中源码管理下的[Git]
- Repository URL:https://github.com/ysm20140508/fundCrawLer/]
- Credentials:认证
- Branches to build:*/master
- 选中构建触发器下的[Build when a change is pushed to Github]
- 选中构建环境下的[Add timestamps to the Console Output]
- 选中构建下的[invoke top-level Maven targets] Maven Version: maven名称 Goals: clean pack
- 选中构建下的[Execute shell] Command: BUILD_ID=dontKillMe java -jar target/fundCrawler-1.0.jar &