问题描述
我们使用Jenkins作为构建协调器,并且只是在针对特定项目使用Azure DevOps.无论是从git自动触发还是手动触发,我们的构建都能正常运行,从Git中提取代码并创建所需的工件.
We use Jenkins as our build orchestrator, and are just spiking the use of Azure DevOps for a particular project. Our build works fine, pulling code from Git and creating the artifacts we need, whether we trigger automatically from git or manually.
不过,我仍然希望Jenkins成为协调员,以便我们的渠道对于不在我们团队中的人更加明显.
I still want Jenkins to be the orchestrator however, so that our pipeline is more obvious to people not in our team.
关于从DevOps触发Jenkins的信息很多,但是我还没有找到任何能满足我们需求的东西.有可能吗,请您分享一些例子吗?
There is a lot of info about triggering Jenkins from DevOps, but I haven't found anything to support what we need. Is it possible, and can you share any examples please?
推荐答案
您可以使用其REST API在Azure DevOps中触发生成. 用于触发构建的API记录在这里.
You can trigger a build in Azure DevOps using its REST API. The API for triggering build is documented here.
基本上,这是对以下端点的POST操作:
Basically it's a POST operation to the following endpoint:
POST https://dev.azure.com/{organization}/{project}/_apis/build/builds?api-version=5.0
And authentication can be done using OAuth or Personal Access Token as documented here.
根据您选择的技术,也可能有一个可以使用的客户端对象模型.
这篇关于我可以从Jenkins触发Azure DevOps构建吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!