jenkins:传递多个“扩展选择参数";使用URL的值 [英] jenkins: pass multiple "Extended Choice Parameter" values using a URL
问题描述
Jenkins
构建中的参数之一是扩展选择参数,当从构建网页调用构建时,会以逗号分隔的值的形式提交.
One of the parameters in my Jenkins
build is an Extended Choice Parameter which is submitted as a selection of comma separated values when invoking the build from the build webpage.
但是,我还需要使用wget
+ URL
调用构建.
However, I also need to invoke the build using wget
+ URL
.
因此,格式为:
wget "${JENKINS_URL}/job/buildname/buildWithParameters?ECP_LIST=blah1&token=token"
说我的扩展选择参数ECP_LIST有可能的值:blah1,blah2,blah3,blah4.
Say my Extended Choice Parameter ECP_LIST has possible values: blah1, blah2, blah3, blah4.
例如,如果我调用:
wget "${JENKINS_URL}/job/buildname/buildWithParameters?ECP_LIST=blah3&token=token"
EPC_LIST参数的值blah3开始构建.
the build starts fine with value blah3 for the EPC_LIST parameter.
但是,如果我希望使用两个或多个值来调用它,它只会将一个空白值传递给该参数.
However, if I wish to invoke it with 2 or more values, it just passes a blank value to the parameter.
我尝试使用各种东西来分隔值,例如空格,编码的逗号,分号.我也没有运气在这里或在Google上找到答案.
I've tried separating the values using various things, like spaces, encoded comma, semi-colon. I haven't had any luck finding an answer here or on Google either.
推荐答案
在单引号中包含URL是可行的:
Including the URL in single quotes work:
wget '${JENKINS_URL}/job/buildname/buildWithParameters?ECP_LIST=blah3&token=token'
类似地,如果您希望通过带有curl的Jenkins API运行curl,则可以运行:
Similarly if you want to run a curl through your Jenkins API with curl you would run:
curl -X POST 'http://api:xxxxxxxxxxxxxxxxxxxxxxx@jenkins.YOURSERVER.com/job/BUILDNAME/buildWithParameters?parameter2=blah¶meter2=blahblah'
这篇关于jenkins:传递多个“扩展选择参数";使用URL的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!