API 支持手动批准 Jenkins 中升级的构建吗? [英] API support for manual approval of promoted builds in Jenkins?

查看:24
本文介绍了API 支持手动批准 Jenkins 中升级的构建吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法以编程方式批准 Jenkins 推广的构建?在作业配置中,它已设置为仅在手动批准时".

Is there any way to programmatically approve the Jenkins promoted build? In job configuration it has been set to "Only when manually approved".

推荐答案

是的!虽然我还没有找到任何文档,所以它可能不是一个稳定的解决方案.我使用浏览器开发人员工具发现了这一点.确保选中仅在手动批准时".

Yes! Although I haven't found any documentation for it and so it might not be a stable solution. I found this using the browser developer tools. Make sure "Only when manually approved" is checked.

这是一个例子:

curl 'https://jenkins/job/z-promotion-test/3/promotion/promotionProcess/promotion_test/promotionCondition/hudson.plugins.promoted_builds.conditions.ManualCondition/approve' --data 'json=%7B%7D&Submit=Approve'

认证版本

curl 'http://<user>:<token>@jenkins/job/z-promotion-test/3/promotion/promotionProcess/promotion_test/promotionCondition/hudson.plugins.promoted_builds.conditions.ManualCondition/approve' --data 'json=%7B%7D&Submit=Approve'

  1. http://jenkins/me/configure
  2. https://wiki.jenkins-ci.org/display/JENKINS/远程+访问+API

这篇关于API 支持手动批准 Jenkins 中升级的构建吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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