Zaha1337
Zaha1337

Reputation: 21

Automating mirroring of Azure DevOps Git repository in a private network to AWS CodeCommit

I have a requirement to automatically create a mirror of my Azure DevOps Git repository which is hosted in a private network, to AWS CodeCommit. The goal is to keep both repositories in sync to ensure redundancy and disaster recovery.

I have followed the manual steps to set up the mirror and it works fine. However, I'm looking for a way to automate this process to save time and avoid potential human errors.

The steps I followed manually are:

Cloned the Azure DevOps repository to my local machine. Added AWS CodeCommit as a remote. Pushed the code to AWS CodeCommit using Git commands.

My requirements for the automated solution are as follows:

Automatically clone the Azure DevOps repository. Periodically check for changes in the Azure DevOps repository and sync them to the AWS CodeCommit repository on AWS. Handle conflicts gracefully and avoid overwriting changes in either repository. I have experience with scripting and some basic knowledge of Git, but I'm not sure about the best approach to achieve this automation.

I've stumbled upon an article that possibly could solve my problem but, the solution in following article doesn't work for me since I can't generate the Git credentials in Azure DevOps

Link to the article: https://aws.amazon.com/blogs/devops/use-aws-codecommit-to-mirror-an-azure-devops-repository-using-an-azure-devops-pipeline/

Thank you!

Upvotes: -1

Views: 508

Answers (1)

Daniel Lemke
Daniel Lemke

Reputation: 2449

Are you sure you're looking at the right UI? If you navigate to the "Repos" menu, there's a "Generate Git Credentials" button immediately on the top of the page, see below.

enter image description here

Using that, you should be able to follow the instructions in the blog post. Just note that this is one-way sync, so you can think of your repo in Azure as the "source of truth" while the AWS CodeCommit repo will only serve as target that mirrors the changes. So you shouldn't commit anything to the CodeCommit repo as these changes will not be mirrored back to the Azure Repo. That's "normal" though as it would become super messy to keep to independent Git repos in sync. The repo where the changes are mirrored to should really be used only as a backup and NOT by developers in their regular development workflow.

Upvotes: 0

Related Questions