从 Jenkins 外部调用 Jenkins 构建? [英] Calling a Jenkins build from outside of Jenkins?

查看:19
本文介绍了从 Jenkins 外部调用 Jenkins 构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Jenkins 的新手,我不确定这是否可行,但我想设置一个 Web 界面,有人可以在其中单击开始工作",这将告诉 Jenkins 开始特定的构建工作.

I am new to Jenkins, and I'm not sure if this is possible, but I would like to set up a web interface where somebody could click "Start Job" and this will tell Jenkins to start a particular build job.

Jenkins 是否有允许这种事情发生的网络服务?如果是这样,一个简单的例子是什么?

Does Jenkins have a webservice that would allow such a thing? If so, what would be a simple example?

推荐答案

这里是文档的链接:Jenkins 远程访问 API.

Here is a link to the documentation: Jenkins Remote Access API.

查看提交工作部分.

在您的作业配置中,您设置了一个令牌,然后创建一个 POST 请求到 JENKINS_URL/job/JOBNAME/build?token=TOKEN.这可能是最基本的用法.

In your job configuration you setup a token and then create a POST request to JENKINS_URL/job/JOBNAME/build?token=TOKEN. That's probably the most basic usage.

这篇关于从 Jenkins 外部调用 Jenkins 构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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