diff --git a/images/linux/scripts/installers/dotnetcore-sdk.sh b/images/linux/scripts/installers/dotnetcore-sdk.sh index ff966cd28..31210b6ef 100644 --- a/images/linux/scripts/installers/dotnetcore-sdk.sh +++ b/images/linux/scripts/installers/dotnetcore-sdk.sh @@ -9,15 +9,9 @@ source $HELPER_SCRIPTS/install.sh source $HELPER_SCRIPTS/os.sh # Ubuntu 20 doesn't support EOL versions -if isUbuntu20 ; then - LATEST_DOTNET_PACKAGES=("dotnet-sdk-3.1") - release_urls=("https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.1/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.1/releases.json") -fi - -if isUbuntu16 || isUbuntu18 ; then - LATEST_DOTNET_PACKAGES=("dotnet-sdk-3.0" "dotnet-sdk-3.1") - release_urls=("https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.1/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.0/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.1/releases.json") -fi +toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json" +LATEST_DOTNET_PACKAGES=$(jq -r '.dotnet.aptPackages[]' $toolset) +versions=$(jq -r '.dotnet.versions[]' $toolset) mksamples() { @@ -50,7 +44,8 @@ done # Get list of all released SDKs from channels which are not end-of-life or preview sdks=() -for release_url in ${release_urls[@]}; do +for version in ${versions[@]}; do + release_url="https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/${version}/releases.json" echo "${release_url}" releases=$(curl "${release_url}") sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdk.version')) diff --git a/images/linux/toolsets/toolset-1604.json b/images/linux/toolsets/toolset-1604.json index 1c5ff5320..4708718bb 100644 --- a/images/linux/toolsets/toolset-1604.json +++ b/images/linux/toolsets/toolset-1604.json @@ -188,5 +188,16 @@ "node:12-alpine", "ubuntu:14.04" ] + }, + "dotnet": { + "aptPackages": [ + "dotnet-sdk-3.0", + "dotnet-sdk-3.1" + ], + "versions": [ + "2.1", + "3.0", + "3.1" + ] } } diff --git a/images/linux/toolsets/toolset-1804.json b/images/linux/toolsets/toolset-1804.json index 226dd190a..d3a94212c 100644 --- a/images/linux/toolsets/toolset-1804.json +++ b/images/linux/toolsets/toolset-1804.json @@ -192,5 +192,16 @@ "package": "aws-sam-cli", "cmd": "sam" } - ] + ], + "dotnet": { + "aptPackages": [ + "dotnet-sdk-3.0", + "dotnet-sdk-3.1" + ], + "versions": [ + "2.1", + "3.0", + "3.1" + ] + } } diff --git a/images/linux/toolsets/toolset-2004.json b/images/linux/toolsets/toolset-2004.json index 76f2af421..b4c17da09 100644 --- a/images/linux/toolsets/toolset-2004.json +++ b/images/linux/toolsets/toolset-2004.json @@ -166,5 +166,14 @@ "package": "aws-sam-cli", "cmd": "sam" } - ] + ], + "dotnet": { + "aptPackages": [ + "dotnet-sdk-3.1" + ], + "versions": [ + "2.1", + "3.1" + ] + } }