forked from dotnet/dotnet-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-drop-versions.sh
executable file
·34 lines (22 loc) · 1.11 KB
/
get-drop-versions.sh
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
#!/usr/bin/env bash
# Stop script on NZEC
set -e
# Stop script if unbound variable found (use ${var:-} if intentional)
set -u
channel=$1
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends libxml2-utils
curl -SLo sdk.zip https://aka.ms/dotnet/$channel/Sdk/dotnet-sdk-win-x64.zip
unzip -p sdk.zip "sdk/*/.version" > sdkversion
commitSha=$(cat sdkversion | head -1)
commitSha=${commitSha%?} # Remove last character (newline)
sdkVer=$(cat sdkversion | head -2 | tail -1)
rm sdkversion
curl -SLo versionDetails.xml https://raw.githubusercontent.com/dotnet/installer/$commitSha/eng/Version.Details.xml
runtimeVer=$(xmllint --xpath string\(//ProductDependencies/Dependency[@Name=\'Microsoft.NETCore.App.Internal\']/@Version\) versionDetails.xml)
aspnetVer=$(xmllint --xpath string\(//ProductDependencies/Dependency[@Name=\'Microsoft.AspNetCore.App.Ref.Internal\']/@Version\) versionDetails.xml)
rm sdk.zip
rm versionDetails.xml
echo "##vso[task.setvariable variable=sdkVer]$sdkVer"
echo "##vso[task.setvariable variable=runtimeVer]$runtimeVer"
echo "##vso[task.setvariable variable=aspnetVer]$aspnetVer"