@@ -20,15 +20,16 @@ parameters:
2020variables :
2121- group : DotNet-Source-Build-All-Orgs-Source-Access
2222- name : RepoDir
23- value : ' vmr'
23+ value : vmr
2424- name : GitUser
25- value : ' dn-bot'
25+ value : dn-bot
2626- name : GitEmail
27- 27+ 2828
2929jobs :
3030- ${{ each mirror in parameters.mirrors }} :
3131 - job :
32+ displayName : Mirror ${{ mirror.sourceUrl }}
3233 steps :
3334 - checkout : none
3435
@@ -39,11 +40,13 @@ jobs:
3940 git init "${repo_dir}"
4041 cd "${repo_dir}"
4142
43+ echo "Setting up git in ${repo_dir} repo for ${{ mirror.sourceUrl }} -> ${{ mirror.destinationUrl }}"
44+
4245 git config --global user.name "${{ variables.GitUser }}"
4346 git config --global user.email "${{ variables.GitEmail }}"
4447
45- source_url=$(echo " ${{ mirror.sourceUrl }}" | sed "s,https://.*@,https://${{ variables.GitUser }}:${AZDO_PAT}@,g")
46- destination_url=$(echo " ${{ mirror.destinationUrl }}" | sed "s,https://.*@,https://${{ variables.GitUser }}:${AZDO_PAT}@,g")
48+ source_url=$(echo ' ${{ mirror.sourceUrl }}' | sed "s,https://.*@,https://${{ variables.GitUser }}:${AZDO_PAT}@,g")
49+ destination_url=$(echo ' ${{ mirror.destinationUrl }}' | sed "s,https://.*@,https://${{ variables.GitUser }}:${AZDO_PAT}@,g")
4750
4851 git remote add source "${source_url}"
4952 git remote add destination "${destination_url}"
6265 message=".NET Source-build ${{ branch.sdkVersion }}-SDK"
6366 git tag "${tag_name}" HEAD -m "${message}"
6467
65- git fetch destination " ${{ branch.name }}"
68+ git fetch destination ' ${{ branch.name }}' || echo 'Branch ${{ branch.name }} does not exist in destination yet'
6669
6770 git push --follow-tags destination "${{ branch.name }}"
6871 workingDirectory: $(Pipeline.Workspace)/$(RepoDir)
0 commit comments