Skip to content

Commit

Permalink
[d16-9][VSTS][CI] Fix issues with the internal pool and VSTS git usag…
Browse files Browse the repository at this point in the history
…e. (dotnet#10559)

The internal pool, for some reason, do not like the cred store. We need
this to fix the interaction with the maccore repo.

1. VSTS uses https
2. We need to set the pat and try no to modify all bash scripts.

We do so by changing the remote url of maccores git repo so that it
includes the pat.
  • Loading branch information
mandel-macaque authored Feb 1, 2021
1 parent 04bdcda commit 9a9f480
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tools/devops/automation/templates/build/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ steps:
clean: true

- pwsh: |
rm -Rf "$HOME\.git-credentials"
# should we need sudo, no, but someone did something wrong in the images..
sudo rm -Rf "$HOME/.git-credentials"
git config --global credential.helper store
Set-Content -Path "$HOME\.git-credentials" -Value "https://$(GitHub.Token):[email protected]`n" -NoNewline
displayName: 'Add git creds store'
Set-Content -Path "$HOME/.git-credentials" -Value "https://$(GitHub.Token):[email protected]`n" -NoNewline
# maccore is special, we use fetch there in some bash scripts, but VSTS uses https.. and some pools don't like the above.. :/
cd $(System.DefaultWorkingDirectory)/maccore
git remote remove origin
git remote add origin https://$(GitHub.Token)@github.com/xamarin/maccore.git
git remote # don't add -v else we see the pat
displayName: 'Clean git mess from VSTS'

- powershell: |
gci env: | format-table -autosize -wrap
Expand Down Expand Up @@ -481,6 +488,7 @@ steps:
condition: and(succeededOrFailed(), contains(variables['runTests.TESTS_RAN'], 'True')) # if tests did not run, there is nothing to do

- pwsh: |
rm -Rf "$HOME\.git-credentials"
# should we need sudo, no, but someone did something wrong in the images..
sudo rm -Rf "$HOME/.git-credentials"
displayName: 'Remove git creds store'
condition: always()

0 comments on commit 9a9f480

Please sign in to comment.