Jenkins 获取BUILD_USER命名build_history

栏目: Java · 发布时间: 6年前

内容简介:说明:构建触发器Execute shell Command

默认生成的构建历史只有数字,看起来非常不直观。

Jenkins 获取BUILD_USER命名build_history

设置如下

Jenkins 获取BUILD_USER命名build_history

说明:

  • Set Build Name 就是最后要生成的每条的样子

  • Set jenkins user build variables 就能获取到 BUILD_USER ,就是当前用户

  • BUILD_NUMBER 就是数字,每次+1

  • commit和online_host 是自定义的变量从这里来

Jenkins 获取BUILD_USER命名build_history

效果如下

  • 清晰明了
Jenkins 获取BUILD_USER命名build_history

gitlab 的merge request 触发jenkins 构建。

构建触发器

jenkins设置:

Jenkins 获取BUILD_USER命名build_history
  • Build on Merge Request Events和Build on Push Events都是当什么事件才会接收,按需打勾
  • Filter branches by regex 只接收master分支

gitlab设置:

Jenkins 获取BUILD_USER命名build_history
  • URL :输入 jenkins 里面展示的地址 看上图。
  • 只勾选Merge Request events 即可,只有Merge会触发
  • SSL verification 不用勾
  • 点test 按钮 可以测试一下

notify:

Execute shell Command

curl -S -m 5 -H "X-TOKEN: 123456789099876588" "http://notify.我司域名.com/api/dingtalk/message/send?receiver=$RECEIVER&content=$CONTENT"
复制代码

这个通知网址是我司自己搭建的。

Jenkins 获取BUILD_USER命名build_history
钉钉通知参考链接

以上所述就是小编给大家介绍的《Jenkins 获取BUILD_USER命名build_history》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Uberland

Uberland

Alex Rosenblat / University of California Press / 2018-11-19 / GBP 21.00

Silicon Valley technology is transforming the way we work, and Uber is leading the charge. An American startup that promised to deliver entrepreneurship for the masses through its technology, Uber ins......一起来看看 《Uberland》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

URL 编码/解码
URL 编码/解码

URL 编码/解码