将镜像代码从Azure存储库镜像到AWS代码提交

我将代码存储库从bitbucket移到Azure存储库。我面临的问题是我可以在bitbucket中设置钩子,以将存储库镜像到AWS代码提交。但是,我在Azure存储库中找不到此类功能

有什么办法吗?

致谢

iCMS 回答:将镜像代码从Azure存储库镜像到AWS代码提交

azure存储库中没有可与Bitbucket存储库同步的即用型功能。

但是,您可以通过azure管道实现此目标。请参阅以下步骤:

1,创建一个天蓝色的管道(例如经典的UI管道)。有关详细步骤,请查看this tutorial

2,在管道中添加一个脚本任务以运行git命令。

  • 将位桶与Azure repo代码提交同步。

- powershell: |
    git config --global user.email "you@example.com"
    git config --global user.name "bitbuckt username"
 
    git push https://username:password@bitbucket.org/name/repo.git HEAD:$(Build.SourceBranchName) -q
    #if your password or username contain @ replace it with %40
  • 将Azure存储库与位桶代码提交同步。

- powershell: |
    git config --global user.email "you@example.com"
    git config --global user.name "azure account name"
    git clone https://username:password@bitbucket.org/name/repo.git
    cd repo
    git push https://$(System.AccessToken)@dev.azure.com/organ/proj/_git/repo HEAD:$(Build.SourceBranchName) -q

您可以为天青管道启用Enable continuous integration。这样,每次在天蓝色的回购中有代码提交时。管道将被触发,代码将同步到bitbucket存储库。

enter image description here

本文链接:https://www.f2er.com/2031313.html

大家都在问