【发布时间】:2019-07-24 09:49:40
【问题描述】:
我正在创建一个集成管道,该管道应该执行依赖项目的构建管道(作为验证构建)。所有这些项目都托管在他们自己的团队项目中的 Azure DevOps 中。为了调用各自的管道,我想到了使用repository 资源。
根据文档here 和here,应该可以从不同的存储库执行 YAML 模板。这些示例展示了如何将 repository 资源用于 GitHub 托管的存储库,但不清楚如何连接到 Azure Repos 上托管的不同团队项目。当托管在同一个团队项目中时,可以按照this answer 中的说明完成。
我试过这个:
resources:
repositories:
- repository: MyRepoAlias
type: git
name: MyRepo
ref: 'refs/heads/master'
# Adding/omitting an endpoint doesn't matter
endpoint: 'MyRepo Service Connection'
pool:
vmImage: 'windows-2019'
steps:
# Calling template on the reference repository
- template: '.\Templates\RunBuild.yml@MyRepoAlias'
作为记录,参考存储库存在于同一个 AzD 组织中。我是否将“端点”属性添加到端点也没关系。在这种情况下,我使用基于令牌的身份验证和完全访问 PAT 将其链接到“Azure Repos/Team Foundation Server”类型的服务连接。
问题:
- 有人知道如何从 YAML 中的不同团队项目中引用 Azure Repos 托管的 Git 存储库吗?
- 在 AzD 中可能有一些替代方法将管道链接在一起?
【问题讨论】:
标签: git azure-devops azure-pipelines