如何在Azure管道任务中将文件从一个Git仓库复制到另一个Git仓库?

huangapple go评论61阅读模式
英文:

How to copy files from one git repo to another git repo in Azure pipelines task?

问题

有一个在GitHub上的公共源代码存储库,其中包含所有的源代码。还有另一个属于我的GitHub存储库,其中包含一些配置文件。
我想要使用Azure管道任务,在我的GitHub存储库中的配置文件的帮助下运行源存储库的一些测试。

如何首先检出GitHub源存储库,然后进行初始设置,比如在该存储库中构建?之后,将配置文件从我的另一个GitHub存储库复制到源存储库目录,并运行源存储库的测试。
我想在Azure YAML管道中执行这些步骤,因为从Azure发布管道中并非所有工件都是可访问的。

英文:

There is one public source repo in github where all the source code is present. There is another github repo of mine which has some configuration files.
I want to run some tests of source repo using the configuration file present in my github repo using Azure pipeline task.

How can I checkout to source repo of github first and then do initial setup like build in that repo? And after that copy configuration files from my another github repo to the source repo directory and run tests of source repo.
I want to do these steps in Azure yaml pipelines as from azure release pipelines not all the artifacts are accessible.

答案1

得分: 0

检查多个存储库是可能的,也可以使用GitHub作为源,但不要忘记设置GitHub服务连接

有关更多信息和选项,请参阅:https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#specify-multiple-repositories

由于您希望GitHub存储库触发Azure DevOps管道,请查看自2022年10月以来提供的功能:
https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/github-actions?view=azure-devops

英文:

Checking out multiple repos is possible, also with GitHub as a source, but don't forget to setup a GitHub service connection.

More info and options about this see: https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#specify-multiple-repositories

Since you want the GitHub repo to trigger the Azure DevOps pipeline, please check out the feature that is available since October 2022:
https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/github-actions?view=azure-devops

huangapple
  • 本文由 发表于 2023年2月10日 02:32:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75402974.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定