通过 curl POST 将参数传递给 jenkins 作业不起作用? [英] passing parameter to jenkins job through curl POST not working?
问题描述
我尝试启动
curl -X POST -u "user:pass" -H Jenkins-Crumb:thecrumbnumber http://myjenkinsserver/jenkins/job/testjob/buildWithParameters?=PARAMETER=somenumber
它通过触发参数化构建来工作,但问题是没有值传递给构建(即使在作业中设置了令牌,这很奇怪,我可以在没有它的情况下触发作业).在 jenkins 中,该作业有一个配置的字符串PARAMETER",带有或不带有一些默认值,但从未传递来自 curl 启动的参数.我可能缺少什么?
which works by triggering a parametrized build, but the problem is no value is passed to the build (whats weird even when the token is set in the job, I can trigger the job without it). In jenkins, that job has a configured string "PARAMETER" with or without some default value, but never the parameter from the curl launch is passed. What I may be missing?
推荐答案
我正在使用:
curl -X POST -u "user" "http://myjenkins/path/to/my/job/buildWithParameters?GERRIT_REFNAME=feature/retry&goal=package"
在这里,它就像一个魅力.
here and it's working like a charm.
注意您粘贴的 URL 中PARAMETER"前面的=".
Watch out the "=" in front of the "PARAMETER" in the URL you pasted.
这篇关于通过 curl POST 将参数传递给 jenkins 作业不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!