Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Updates] Automated vendor dotnet-install script #1246

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dotnet/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "dotnet",
"version": "2.2.0",
"version": "2.2.1",
"name": "Dotnet CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/dotnet",
"description": "This Feature installs the latest .NET SDK, which includes the .NET CLI and the shared runtime. Options are provided to choose a different version or additional versions.",
Expand Down
27 changes: 5 additions & 22 deletions src/dotnet/scripts/vendor/dotnet-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1396,24 +1396,15 @@ get_feeds_to_use()
{
feeds=(
"https://builds.dotnet.microsoft.com/dotnet"
"https://dotnetcli.azureedge.net/dotnet"
"https://ci.dot.net/public"
"https://dotnetbuilds.azureedge.net/public"
)

if [[ -n "$azure_feed" ]]; then
feeds=("$azure_feed")
fi

if [[ "$no_cdn" == "true" ]]; then
feeds=(
"https://dotnetcli.blob.core.windows.net/dotnet"
"https://dotnetbuilds.blob.core.windows.net/public"
)

if [[ -n "$uncached_feed" ]]; then
feeds=("$uncached_feed")
fi
if [[ -n "$uncached_feed" ]]; then
feeds=("$uncached_feed")
fi
}

Expand Down Expand Up @@ -1545,7 +1536,7 @@ generate_regular_links() {
link_types+=("legacy")
else
legacy_download_link=""
say_verbose "Cound not construct a legacy_download_link; omitting..."
say_verbose "Could not construct a legacy_download_link; omitting..."
fi

# Check if the SDK version is already installed.
Expand Down Expand Up @@ -1648,7 +1639,7 @@ install_dotnet() {
say "The resource at $link_type link '$download_link' is not available."
;;
*)
say "Failed to download $link_type link '$download_link': $download_error_msg"
say "Failed to download $link_type link '$download_link': $http_code $download_error_msg"
;;
esac
rm -f "$zip_path" 2>&1 && say_verbose "Temporary archive file $zip_path was removed"
Expand Down Expand Up @@ -1709,7 +1700,6 @@ install_dir="<auto>"
architecture="<auto>"
dry_run=false
no_path=false
no_cdn=false
azure_feed=""
uncached_feed=""
feed_credential=""
Expand Down Expand Up @@ -1782,10 +1772,6 @@ do
verbose=true
non_dynamic_parameters+=" $name"
;;
--no-cdn|-[Nn]o[Cc]dn)
no_cdn=true
non_dynamic_parameters+=" $name"
;;
--azure-feed|-[Aa]zure[Ff]eed)
shift
azure_feed="$1"
Expand Down Expand Up @@ -1890,13 +1876,10 @@ do
echo " --verbose,-Verbose Display diagnostics information."
echo " --azure-feed,-AzureFeed For internal use only."
echo " Allows using a different storage to download SDK archives from."
echo " This parameter is only used if --no-cdn is false."
echo " --uncached-feed,-UncachedFeed For internal use only."
echo " Allows using a different storage to download SDK archives from."
echo " This parameter is only used if --no-cdn is true."
echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable."
echo " -SkipNonVersionedFiles"
echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly."
echo " --jsonfile <JSONFILE> Determines the SDK version from a user specified global.json file."
echo " Note: global.json must have a value for 'SDK:Version'"
echo " --keep-zip,-KeepZip If set, downloaded file is kept."
Expand Down Expand Up @@ -1956,4 +1939,4 @@ fi

say "Note that the script does not resolve dependencies during installation."
say "To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the \"Dependencies\" section."
say "Installation finished successfully."
say "Installation finished successfully."
2 changes: 1 addition & 1 deletion src/oryx/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "oryx",
"version": "1.4.0",
"version": "1.4.1",
"name": "Oryx",
"description": "Installs the oryx CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/oryx",
Expand Down
27 changes: 5 additions & 22 deletions src/oryx/scripts/vendor/dotnet-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1396,24 +1396,15 @@ get_feeds_to_use()
{
feeds=(
"https://builds.dotnet.microsoft.com/dotnet"
"https://dotnetcli.azureedge.net/dotnet"
"https://ci.dot.net/public"
"https://dotnetbuilds.azureedge.net/public"
)

if [[ -n "$azure_feed" ]]; then
feeds=("$azure_feed")
fi

if [[ "$no_cdn" == "true" ]]; then
feeds=(
"https://dotnetcli.blob.core.windows.net/dotnet"
"https://dotnetbuilds.blob.core.windows.net/public"
)

if [[ -n "$uncached_feed" ]]; then
feeds=("$uncached_feed")
fi
if [[ -n "$uncached_feed" ]]; then
feeds=("$uncached_feed")
fi
}

Expand Down Expand Up @@ -1545,7 +1536,7 @@ generate_regular_links() {
link_types+=("legacy")
else
legacy_download_link=""
say_verbose "Cound not construct a legacy_download_link; omitting..."
say_verbose "Could not construct a legacy_download_link; omitting..."
fi

# Check if the SDK version is already installed.
Expand Down Expand Up @@ -1648,7 +1639,7 @@ install_dotnet() {
say "The resource at $link_type link '$download_link' is not available."
;;
*)
say "Failed to download $link_type link '$download_link': $download_error_msg"
say "Failed to download $link_type link '$download_link': $http_code $download_error_msg"
;;
esac
rm -f "$zip_path" 2>&1 && say_verbose "Temporary archive file $zip_path was removed"
Expand Down Expand Up @@ -1709,7 +1700,6 @@ install_dir="<auto>"
architecture="<auto>"
dry_run=false
no_path=false
no_cdn=false
azure_feed=""
uncached_feed=""
feed_credential=""
Expand Down Expand Up @@ -1782,10 +1772,6 @@ do
verbose=true
non_dynamic_parameters+=" $name"
;;
--no-cdn|-[Nn]o[Cc]dn)
no_cdn=true
non_dynamic_parameters+=" $name"
;;
--azure-feed|-[Aa]zure[Ff]eed)
shift
azure_feed="$1"
Expand Down Expand Up @@ -1890,13 +1876,10 @@ do
echo " --verbose,-Verbose Display diagnostics information."
echo " --azure-feed,-AzureFeed For internal use only."
echo " Allows using a different storage to download SDK archives from."
echo " This parameter is only used if --no-cdn is false."
echo " --uncached-feed,-UncachedFeed For internal use only."
echo " Allows using a different storage to download SDK archives from."
echo " This parameter is only used if --no-cdn is true."
echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable."
echo " -SkipNonVersionedFiles"
echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly."
echo " --jsonfile <JSONFILE> Determines the SDK version from a user specified global.json file."
echo " Note: global.json must have a value for 'SDK:Version'"
echo " --keep-zip,-KeepZip If set, downloaded file is kept."
Expand Down Expand Up @@ -1956,4 +1939,4 @@ fi

say "Note that the script does not resolve dependencies during installation."
say "To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the \"Dependencies\" section."
say "Installation finished successfully."
say "Installation finished successfully."
Loading