gpt4 book ai didi

azure-devops - 如何指向 Azure Pipelines 构建的引用存储库上的特定提交

转载 作者:行者123 更新时间:2023-12-03 16:23:38 27 4
gpt4 key购买 nike

我们的团队使用基于另一个存储库中的代码运行的 Azure DevOps 管道。我们在存储库中编写了一个 yaml 文件,该文件引用了 Azure DevOps Pipeline 的另一个存储库,如下所示:

resources:
repositories:
- repository: e2e_fx
type: github
name: Azure/iot-sdks-e2e-fx
ref: refs/heads/master
endpoint: 'GitHub OAuth'

jobs:
- template: vsts/templates/jobs-gate-c.yaml@e2e_fx

当前 yaml 指向另一个存储库的 master 头,因此如果将新提交添加到该远程存储库,那么它将被指向。我希望能够从所引用的存储库中引用特定的提交。我怎样才能做到这一点?

作为引用,我已经尝试复制我想要引用的特定提交并将其粘贴到 refs/heads/master 现在所在的位置,但这给出了错误。

最佳答案

目前,在 .yaml 中没有选项可以开箱即用。文件。

您可以配置 .yamlnot sync sources ,那么构建将不会下载存储库,并且在构建的开头添加一个命令行任务来仅下载您想要的提交。

要告诉 . yaml不同步 steps: 中的源添加 - checkout: none :

steps:
- checkout: none # Don't sync sources

关于azure-devops - 如何指向 Azure Pipelines 构建的引用存储库上的特定提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56158097/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com