jenkins实现spring cloud项目的自动化部署

  1. 安装maven插件
    点击系统管理-插件管理,搜索maven,找到Maven Integration plugin并安装
    jenkins实现spring cloud项目的自动化部署
  2. 设置maven插件
    点击系统管理-全局工具配置,找到maven设置
    jenkins实现spring cloud项目的自动化部署
  3. 建立一个maven任务
    点击新建任务,选择构建一个maven项目
    jenkins实现spring cloud项目的自动化部署
  4. 设置gitlab连接和构建保存的数量
    jenkins实现spring cloud项目的自动化部署
  5. 设置代码来源,选择Git
    jenkins实现spring cloud项目的自动化部署
  6. 设置触发器,选择轮询scm(poll scm),定时检测Git分支,如果有改变就触发构建
    jenkins实现spring cloud项目的自动化部署
  7. 设置Build
    设置pom.xml路径和maven编译参数
    jenkins实现spring cloud项目的自动化部署
  8. 设置远程ssh服务器和启动脚本
    jenkins实现spring cloud项目的自动化部署
  9. 点击构建,选择要发布的分支
    jenkins实现spring cloud项目的自动化部署
  10. 查看构建情况,蓝色说明打包成功
    jenkins实现spring cloud项目的自动化部署
  11. 点击console output查看构建情况
    jenkins实现spring cloud项目的自动化部署