蔚蓝管道。 运行 来自资源库的脚本

Azure Pipelines. Run script from resource repo

我在 repo 中有 azure 管道的 yaml 文件。我需要 运行 来自不同 repo 的 powershell 脚本。

据我所知,我可以将侧回购添加到 yaml 中的 resources 部分,然后使用 task:ShellScript@2scriptPath 参数。但据我了解,它对于放置 yaml 的 repo 相对有效。而且我不确定如何从不同的存储库访问文件。

是的,您必须使用存储库资源并按如下方式检出该存储库:

resources:
  repositories:
    - repository: devops
      type: github
      name: kmadof/devops-templates
      endpoint: kmadof


steps:
- checkout: self
- checkout: devops
- task: ShellScript@2
  inputs:
    scriptPath: $(Agent.BuildDirectory)/devops/scripts/some-script.sh