我正在使用Python请求在Jenkins中触发具有参数的构建,网址为http://jenkins:8080/view/projectAlpha/job/deploy_job_with_params/build,但我没有得到任何队列或构建号来标识我的构建。
根据Jenkins上面/api页面的说明:
"To programmatically schedule a new build, post to this URL (means the /build url - RaamEEIL). If the build has parameters, post to this URL (means the /buildWithParameters url - RaamEEIL) and provide the parameters as form data. Either way, the successful queueing will result in 201 status code with Location HTTP header pointing the URL of the item in the queue."
然而,在部署构建时返回的location header中,我没有得到队列url(例如http://jenkins:8080/queue/item/21038/api/json),而是得到了网址http://jenkins:8080/view/projectAlpha/job/deploy_job_with_params/,因此基本上我没有得到任何队列号或构建号。
我读到一个解决方法的建议,发送一个包含一些ID的附加参数,我可以用它来验证最新的构建是否是我的构建,或者用它来搜索构建列表,直到找到正确的构建。
谢谢。
根据Jenkins上面/api页面的说明:
"To programmatically schedule a new build, post to this URL (means the /build url - RaamEEIL). If the build has parameters, post to this URL (means the /buildWithParameters url - RaamEEIL) and provide the parameters as form data. Either way, the successful queueing will result in 201 status code with Location HTTP header pointing the URL of the item in the queue."
然而,在部署构建时返回的location header中,我没有得到队列url(例如http://jenkins:8080/queue/item/21038/api/json),而是得到了网址http://jenkins:8080/view/projectAlpha/job/deploy_job_with_params/,因此基本上我没有得到任何队列号或构建号。
我读到一个解决方法的建议,发送一个包含一些ID的附加参数,我可以用它来验证最新的构建是否是我的构建,或者用它来搜索构建列表,直到找到正确的构建。
谢谢。