gpt4 book ai didi

azure - 自动更新从 github 存储库更改为 Azure DevOps

转载 作者:行者123 更新时间:2023-12-02 06:10:33 25 4
gpt4 key购买 nike

我在 Github 上有一个存储库,希望将其集成到 Azure-DevOps 中。我连接了 Github 和 Azure-devops 中的存储库。当我将一些代码提交到 Github 时,所做的更改不会在 Azure 中自动更新。如果 Github 有任何新的更改,我们是否可以自动拉取更改?

非常感谢任何引用/建议。

最佳答案

更新:

Azure DevOps 现在没有这样的内置功能来将 Github 存储库同步到 DevOps 存储库。

如果您需要该功能,您可以在此位置对功能请求进行投票:

https://developercommunity.visualstudio.com/t/automatically-sync-azure-devops-repository-with-gi/516057

当有足够多的人请求新功能时,微软会将其纳入 future 的产品计划中。

1、您需要使用代码/脚本来同步存储库,并使用 YAML 管道的 CI 触发器来捕获 Github 存储库中的更改。

trigger:
- <branch name>

pool:
vmImage: ubuntu-latest

variables:
- name: system.debug
value: true

steps:
- script: |
echo put the logic here
displayName: 'Push changes to DevOps repo'

代码可以引用这个页面:

https://dileepveldi.medium.com/sync-azure-devops-repo-with-github-repo-35a958d7784e

2、上述管道推送更改后,您需要通过 DevOps 端 YAML 管道的 CI 触发器捕获更改。

trigger:
- <branch name>

pool:
vmImage: ubuntu-latest

variables:
- name: system.debug
value: true

steps:
- script: |
echo xxx
displayName: 'Run a multi-line script'

原始答案:

例如,如果您的意思是集成 Github 存储库和 Azure DevOps 管道,则需要在存储库的主分支上进行持续集成。

然后,按照以下步骤操作。

1、对于经典管道:

enter image description here

2、对于 YAML 管道:

trigger:
- main

pool:
vmImage: ubuntu-latest

steps:
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'

如果您的意思不是集成 Github 存储库和 Azure DevOps 管道,请澄清您的要求。

关于azure - 自动更新从 github 存储库更改为 Azure DevOps,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73191609/

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