简体   繁体   English

Jenkins内部版本号将替换为Tag或Commit ID

[英]Jenkins build number to be replaced with Tag or Commit ID

Is there a plugin which replaces Jenkins build number with the Tag the commit points to or in the absence of a tag the commit ID. 是否有一个插件用提交所指向的标签替换Jenkins内部版本号,或者在没有标签的情况下使用提交ID。 I know this can be scripted and then using Build Name Setter Plugin i can modify the name (it does not work if my build fails) but is there any other nice plugin to perform the above function? 我知道可以编写脚本,然后使用Build Name Setter插件修改名称(如果我的构建失败,它将不起作用),但是还有其他漂亮的插件可以执行上述功能吗?

I wouldn't recommend to change the build number with revision. 我不建议通过修订更改内部版本号。 Easiest way is to set a description . 最简单的方法是设置说明

Then it's a matter of: 然后是一个问题:

  1. Add build step in the build section of the job 在作业的构建部分中添加构建步骤
  2. Select "Add build description" 选择“添加构建描述”
  3. Add your Tag to the description 将标签添加到说明中
  4. Description will be shown right next to the build number 说明将显示在内部编号旁边

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM