通过 curl POST 将参数传递给 jenkins 作业不起作用? [英] passing parameter to jenkins job through curl POST not working?

查看:45
本文介绍了通过 curl POST 将参数传递给 jenkins 作业不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试启动

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屋!

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