更改詹金斯内部版本号 [英] Changing Jenkins build number
本文介绍了更改詹金斯内部版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在工作完成后,是否可以更改通过电子邮件发送的内部版本号?问题在于Jenkins尚未完成产品的构建,因此我们希望能够获取内部版本号(即从文本文件中获取)并在Jenkins中更新内部版本号以与其匹配.我试图设置内部版本号:
Is there a way to change the build number that is sent via email after a job completes? The problem is that are product builds are NOT being done by Jenkins, so we want to be able to get the build number(ie. from a text file) and update the build number in Jenkins to match it. I have tried to set the build number:
set BUILD_NUMBER=45
但是电子邮件仍然显示Jenkins最初设置的内部版本号.
But the email is still showing the build number that Jenkins originally set.
推荐答案
如果您有权访问脚本控制台(管理Jenkins->脚本控制台),则可以执行以下操作:
If you have access to the script console (Manage Jenkins -> Script Console), then you can do this following:
Jenkins.instance.getItemByFullName("YourJobName").updateNextBuildNumber(45)
这篇关于更改詹金斯内部版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文