在Jenkins中,我可以在其他配置字段中使用参数值吗? [英] In Jenkins can I use a parameter value in other config fields?

查看:211
本文介绍了在Jenkins中,我可以在其他配置字段中使用参数值吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Jenkins服务器上设置参数化的版本.

I am setting up a parameterized build on my Jenkins server.

基本上,我想将 git分支名称作为参数.然后,我想在作业配置的其他各个字段中使用该参数.

Basically I want to have the git branch name as a parameter. Then I want to use that parameter in various other fields in the job config.

我什至不知道这是否可能,但我希望这似乎是显而易见的需要.

I don't know if this is even possible, but I hope that it might be as it seems an obvious need.

我能找到的唯一文档是这个旧的Wiki页面
https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

The only docs I could find is this old wiki page
https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

它显示了build参数可以作为ENV变量使用,但没有显示如何在作业配置中的其他地方使用它.

It shows that build parameter is available as an ENV var, but it doesn't show how to use it elsewhere in the job config.

推荐答案

尽管没有文档说明,但此语法在作业配置字段中有效

despite being undocumented, this syntax works in job config fields

${PARAM_NAME}

这篇关于在Jenkins中,我可以在其他配置字段中使用参数值吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆