dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.67k stars 1.06k forks source link

Easy Acquisition via scripts and stable links #8778

Open Petermarcu opened 7 years ago

Petermarcu commented 7 years ago

@tannergooding filed a great issue over here: https://github.com/dotnet/core/issues/483

It hasn't been tracked because thats not a product repo but we should come up with a good plan across the board for how it should work.

@richlander @leecow @KathleenDollard

leecow commented 7 years ago

A start for the metadata can be seen in https://github.com/dotnet/core/blob/master/release-notes/releases.json. I need to make some schema adjustments but that's the idea.

tannergooding commented 6 years ago

I think a good solution would be to provide a stable and logical url form which these can be downloaded.

Goal

Ultimately, I think the goal should be that I can take a generic string, format it, and end up with a usable URL. That is, for something like a powershell script, I should be able to do:

$downloadUrl = "https://get.dot.net/downloads/$platform/$architecture/$version/dotnet-sdk.zip"
Invoke-WebRequest -Uri $downloadUrl -OutFile $destinationPath

Essentially the same code applies to shell scripts calling curl.

The ultimate format of the URL doesn't matter, as long as it is human-readable (no GUIDs for the initial request) and the user can insert the required variables used to differentiate the various install types (Windows vs Linux vs Mac, x86 vs x64 vs Arm; Latest vs v1.0 vs v1.1 vs 2.2; sdk vs runtime vs other standalone distributable).

Goal Blockers

I should not have to:

Example

Nuget, as an example, uses https://dist.nuget.org/<platform>-<architecture>-<area>/<version>/<filename>.

KathleenDollard commented 6 years ago

This makes sense. What are the downsides? (or is there a reason we haven't already done this?)

tannergooding commented 6 years ago

What are the downsides

I wasn't able to think of any currently. I would think there would be some minimal overhead/cost to redirect the URLs to the download.microsoft url (so we can take advantage of the more general distribution servers/etc).

a89h4ya commented 3 months ago

This is still not a thing, is it? We are running an Jfrog Artifactory instance and would like to mirror the sdk installers to prevent unnecessary traffic. We already do that with JDKs, node, gradle, android SDK, go, terraform cli, firefox releases, go and so on and so forth. I was really suprised, that it is impossible with dotnet.

E.g check out https://storage.googleapis.com/golang/

For other tools its harder to guess, as there is no directory listing on the webserver but at least possible by comparing the URLs e.g.

https://corretto.aws/downloads/resources/11.0.18.10.1/amazon-corretto-11.0.18.10.1-linux-x64.tar.gz https://corretto.aws/downloads/resources/21.0.0.35.1/amazon-corretto-21.0.0.35.1-linux-x64.tar.gz