【问题标题】:azure piplines resources template from other github repository来自另一个 github 存储库的 azure 管道资源模板
【发布时间】:2019-03-08 10:46:22
【问题描述】:

我想为我的所有 rust 项目创建一个带有模板的中心点存储库。在其他项目中,我只想添加指向它们的链接:

这是我的模板存储库的示例链接。你可以找到他们here

trigger: ["master"]
pr: ["master"]

resources:
  repositories:
    - repository: templates
      type: github
      name: xoac/rust-azure-pipelines

# Test top level crate
- template: azure-test-stable.yml@templates
  parameters:
    name: test_tokio
    displayName: Test tokio
    cross: true

我收到一个错误here

我找到了需要指定服务连接的here

如果您选择 github 作为您的类型,则 name 是 GitHub 存储库的全名,包括用户或组织。例如,微软/vscode。此外,GitHub 存储库需要 service connection 进行授权。


  • 我不知道这应该是什么类型的连接。
  • 我想让每个想要使用它的人都可以使用它。

【问题讨论】:

    标签: azure azure-devops azure-pipelines


    【解决方案1】:
    1. 这将是一个Github 服务连接(当您创建新的服务连接时)
    2. 权限是在构建级别授予的,而不是在用户级别授予的,因此任何可以启动构建的人都可以启动它并且它会工作
    3. 对于 github 存储库名称,我认为您使用的是正确的名称,但您还需要将 endpoint: service_connection_name 添加到存储库定义中。

    阅读:
    https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#repository-resource

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-20
      • 2022-08-11
      • 1970-01-01
      • 1970-01-01
      • 2017-10-08
      • 2020-07-15
      • 2021-08-04
      • 2020-11-09
      相关资源
      最近更新 更多