我可以从Jenkins触发Azure DevOps构建吗?

问题描述 投票:2回答:2

我们使用Jenkins作为我们的构建协调器,并且只是为特定项目使用Azure DevOps。我们的构建工作正常,从Git中提取代码并创建我们需要的工件,无论我们是从git自动触发还是手动触发。

我仍然希望詹金斯成为协调者,这样我们的管道对于不在我们团队中的人来说就更加明显了。

有很多关于从DevOps触发Jenkins的信息,但我没有找到任何支持我们需要的东西。是否有可能,你可以分享任何例子吗?

azure jenkins build azure-devops continuous-integration
2个回答
2
投票

您可以使用其REST API在Azure DevOps中触发构建。 API for triggering build is documented here

基本上它是对以下端点的POST操作:

POST https://dev.azure.com/{organization}/{project}/_apis/build/builds?api-version=5.0

authentication can be done using OAuth or Personal Access Token as documented here

根据您选择的技术,there may also be a client object model you can use

A powershell sample can be found here


1
投票

这可以使用Azure Pipeline Releases本机完成。

  1. 在Azure DevOps和你的Service Connection之间创建一个Jenkins Server
  2. 在Azure Devops的“管道”部分下的“版本”选项卡中创建新的版本管道
  3. Add an artifact to the release pipeline(在左侧)。在出现的视图中选择“4个更多的工件源”,Jenkins将出现。
  4. 从Jenkins连接的drop中选择您创建的服务连接,然后从下一个下拉列表中选择Jenkins Job。

这使得您的开发人员更清楚地了解正在发生的事情。虽然使用休息是一种很好的方法,它隐藏了很多工作。这样,任何查看发布首页的人都可以看到工件源。

HTH

© www.soinside.com 2019 - 2024. All rights reserved.