Skip to content

Commit

Permalink
Try to head off future build issues (#5770)
Browse files Browse the repository at this point in the history
## Summary of changes

- Vendor the `dotnet-install.sh` and `dotnet-install.ps1` scripts into
the repo
- Replace the centos7 repo references with vault based ones

## Reason for change

- https://dotnet.microsoft.com/ went down recently, which meant we
couldn't download `dotnet-install.sh` or `dotnet-install.ps1`, which
broke a bunch of things, so vendor it.
- Centos7 recently shut down their repo feed, which means you can no
longer pull packages. Use vault repo instead until we deprecate centos7
entirely

## Implementation details

- Vendor the scripts
- Replace downloading of the script with direct reference
- do some `sed` to replace the centos7 repo

## Test coverage

Largely, this is the test, if it all works, I think we're good

## Other details

Supersedes #5759
Requires updating the VMs

<!-- ⚠️ Note: where possible, please obtain 2 approvals prior to
merging. Unless CODEOWNERS specifies otherwise, for external teams it is
typically best to have one review from a team member, and one review
from apm-dotnet. Trivial changes do not require 2 reviews. -->
  • Loading branch information
andrewlock committed Aug 30, 2024
1 parent 58ba195 commit 8f9d794
Show file tree
Hide file tree
Showing 13 changed files with 3,491 additions and 35 deletions.
20 changes: 15 additions & 5 deletions .azure-pipelines/steps/install-dotnet-sdk-manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ steps:
$channel = "${{ parameters.channel }}"
$sdkVersion = "${{ parameters.sdkVersion }}"
echo "Downloading dotnet-install.ps1"
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
$dotnetInstall = "$(System.DefaultWorkingDirectory)\tracer\build\_build\bootstrap\dotnet-install.ps1"
if (Test-Path $dotnetInstall -PathType Leaf) {
echo "Found dotnet-install.ps1 at '$dotnetInstall', skipping download"
} else {
echo "Downloading dotnet-install.ps1"
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
$dotnetInstall = ./dotnet-install.ps1
}
if( "${{ parameters.is64bit }}" -eq "true") {
$path = "$HOME\AppData\Local\Microsoft\dotnet"
Expand All @@ -39,12 +45,16 @@ steps:
echo "Installing dotnet ($arch) to $path"
if($sdkVersion) {
./dotnet-install.ps1 -Version $sdkVersion -Architecture $arch -NoPath:$True -InstallDir $path
& $dotnetInstall -Version $sdkVersion -Architecture $arch -NoPath:$True -InstallDir $path
} else {
./dotnet-install.ps1 -Channel $channel -Architecture $arch -NoPath:$True -InstallDir $path
& $dotnetInstall -Channel $channel -Architecture $arch -NoPath:$True -InstallDir $path
}
if (Test-Path ./dotnet-install.ps1 -PathType Leaf) {
echo "Removing temporary dotnet-install file"
rm ./dotnet-install.ps1
}
rm ./dotnet-install.ps1
echo "Install complete"
displayName: Install dotnet core sdk ${{ parameters.sdkVersion }} (64bit:${{ parameters.is64bit }} ${{ parameters.sdkVersion }})
retryCountOnTaskFailure: 5
Loading

0 comments on commit 8f9d794

Please sign in to comment.