如何从詹金斯获得工作名称 [英] How to get the jobname from jenkins
本文介绍了如何从詹金斯获得工作名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种方法可以在jenkins中获取当前构建的作业名称,并将其作为参数传递给ant构建脚本?
Is there a way to get the jobname for the current build in jenkins and pass it as a parameter to an ant build script?
推荐答案
Jenkins设置了一些环境变量,例如JOB_NAME(请参阅
Jenkins sets some environment variables such as JOB_NAME (see here) for more details on the variables set.
然后您可以通过${env.JOB_NAME}
在ant中访问它们.
You can then access these in ant via ${env.JOB_NAME}
.
同一页面上还有一些关于环境变量的方法这里.
There's also a little howto for environment variables on the same page here.
这篇关于如何从詹金斯获得工作名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文