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!