-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
34 lines (27 loc) · 1.01 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Pipeline to automatically mirror
# an Azure DevOps repository in AWS CodeCommit
# Trigger on all branches
trigger:
- 'aws-pipeline'
# Use latest Ubuntu image
pool:
vmImage: 'ubuntu-latest'
# Pipeline
steps:
- checkout: none
- script: |
# Install urlencode function to encode reserved characters in passwords
sudo apt-get install gridsite-clients
# Create local mirror of Azure DevOps repository
git clone --mirror https://${AZURE_GIT_USERNAME}:$(urlencode ${AZURE_GIT_PASSWORD})@${AZURE_REPO_URL} repo-mirror
# Sync AWS CodeCommit repository
cd repo-mirror
git push --mirror https://${AWS_GIT_USERNAME}:$(urlencode ${AWS_GIT_PASSWORD})@${AWS_REPO_URL}
displayName: 'Sync repository with AWS CodeCommit'
env:
AZURE_REPO_URL: $(AZURE_REPO_URL)
AZURE_GIT_USERNAME: $(AZURE_GIT_USERNAME)
AZURE_GIT_PASSWORD: $(AZURE_GIT_PASSWORD)
AWS_REPO_URL: $(AWS_REPO_URL)
AWS_GIT_USERNAME: $(AWS_GIT_USERNAME)
AWS_GIT_PASSWORD: $(AWS_GIT_PASSWORD)