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

查看:653
本文介绍了通过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天全站免登陆