-
Notifications
You must be signed in to change notification settings - Fork 113
Changes to understand productVersion.txt if found in container with a build #76
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -395,25 +395,28 @@ function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, | |||||
| function Get-Download-Link([string]$AzureFeed, [string]$SpecificVersion, [string]$CLIArchitecture) { | ||||||
| Say-Invocation $MyInvocation | ||||||
|
|
||||||
| # If anything fails in this lookup it will default to $SpecificVersion | ||||||
| $SpecificProductVersion = Get-Product-Version -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion | ||||||
|
|
||||||
| if ($Runtime -eq "dotnet") { | ||||||
| $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificVersion-win-$CLIArchitecture.zip" | ||||||
| $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificProductVersion-win-$CLIArchitecture.zip" | ||||||
| } | ||||||
| elseif ($Runtime -eq "aspnetcore") { | ||||||
| $PayloadURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/aspnetcore-runtime-$SpecificVersion-win-$CLIArchitecture.zip" | ||||||
| $PayloadURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/aspnetcore-runtime-$SpecificProductVersion-win-$CLIArchitecture.zip" | ||||||
| } | ||||||
| elseif ($Runtime -eq "windowsdesktop") { | ||||||
| $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/windowsdesktop-runtime-$SpecificVersion-win-$CLIArchitecture.zip" | ||||||
| $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/windowsdesktop-runtime-$SpecificProductVersion-win-$CLIArchitecture.zip" | ||||||
| } | ||||||
| elseif (-not $Runtime) { | ||||||
| $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificVersion-win-$CLIArchitecture.zip" | ||||||
| $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificProductVersion-win-$CLIArchitecture.zip" | ||||||
| } | ||||||
| else { | ||||||
| throw "Invalid value for `$Runtime" | ||||||
| } | ||||||
|
|
||||||
| Say-Verbose "Constructed primary named payload URL: $PayloadURL" | ||||||
|
|
||||||
| return $PayloadURL | ||||||
| return $PayloadURL, $SpecificProductVersion | ||||||
| } | ||||||
|
|
||||||
| function Get-LegacyDownload-Link([string]$AzureFeed, [string]$SpecificVersion, [string]$CLIArchitecture) { | ||||||
|
|
@@ -434,6 +437,51 @@ function Get-LegacyDownload-Link([string]$AzureFeed, [string]$SpecificVersion, [ | |||||
| return $PayloadURL | ||||||
| } | ||||||
|
|
||||||
| function Get-Product-Version([string]$AzureFeed, [string]$SpecificVersion) { | ||||||
| Say-Invocation $MyInvocation | ||||||
|
|
||||||
| if ($Runtime -eq "dotnet") { | ||||||
| $ProductVersionTxtURL = "$AzureFeed/Runtime/$SpecificVersion/productVersion.txt" | ||||||
|
MattGal marked this conversation as resolved.
|
||||||
| } | ||||||
| elseif ($Runtime -eq "aspnetcore") { | ||||||
| $ProductVersionTxtURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/productVersion.txt" | ||||||
| } | ||||||
| elseif ($Runtime -eq "windowsdesktop") { | ||||||
| $ProductVersionTxtURL = "$AzureFeed/Runtime/$SpecificVersion/productVersion.txt" | ||||||
| } | ||||||
| elseif (-not $Runtime) { | ||||||
| $ProductVersionTxtURL = "$AzureFeed/Sdk/$SpecificVersion/productVersion.txt" | ||||||
| } | ||||||
| else { | ||||||
| throw "Invalid value specified for `$Runtime" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the ` preceeding
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| Say-Verbose "Checking for existence of $ProductVersionTxtURL" | ||||||
|
|
||||||
| try { | ||||||
| $productVersionResponse = GetHTTPResponse($productVersionTxtUrl) | ||||||
|
|
||||||
| if ($productVersionResponse.StatusCode -eq 200) { | ||||||
| $productVersion = $productVersionResponse.Content.ReadAsStringAsync().Result.Trim() | ||||||
| if ($productVersion -ne $SpecificVersion) | ||||||
| { | ||||||
| Say "Using alternate version $productVersion found in $ProductVersionTxtURL" | ||||||
| } | ||||||
|
|
||||||
| return $productVersion | ||||||
| } | ||||||
| else { | ||||||
| Say-Verbose "Got StatusCode $($productVersionResponse.StatusCode) trying to get productVersion.txt at $productVersionTxtUrl, so using default value of $SpecificVersion" | ||||||
| $productVersion = $SpecificVersion | ||||||
| } | ||||||
| } catch { | ||||||
| Say-Verbose "Could not read productVersion.txt at $productVersionTxtUrl, so using default value of $SpecificVersion" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider including
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do; since the existing catches didn't I was trying to follow the pattern. |
||||||
| $productVersion = $SpecificVersion | ||||||
| } | ||||||
|
|
||||||
| return $productVersion | ||||||
| } | ||||||
|
|
||||||
| function Get-User-Share-Path() { | ||||||
| Say-Invocation $MyInvocation | ||||||
|
|
||||||
|
|
@@ -589,7 +637,7 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde | |||||
|
|
||||||
| $CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture | ||||||
| $SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version -JSonFile $JSonFile | ||||||
| $DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture | ||||||
| $DownloadLink, $EffectiveVersion = Get-Download-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture | ||||||
| $LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture | ||||||
|
|
||||||
| $InstallRoot = Resolve-Installation-Path $InstallDir | ||||||
|
|
@@ -638,6 +686,12 @@ else { | |||||
| throw "Invalid value for `$Runtime" | ||||||
| } | ||||||
|
|
||||||
| if ($SpecificVersion -ne $EffectiveVersion) | ||||||
|
MattGal marked this conversation as resolved.
|
||||||
| { | ||||||
| Say "Performing installation checks for effective version: $EffectiveVersion" | ||||||
| $SpecificVersion = $EffectiveVersion | ||||||
| } | ||||||
|
|
||||||
| # Check if the SDK version is already installed. | ||||||
| $isAssetInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage $dotnetPackageRelativePath -SpecificVersion $SpecificVersion | ||||||
| if ($isAssetInstalled) { | ||||||
|
|
@@ -715,4 +769,4 @@ Remove-Item $ZipPath | |||||
| Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath | ||||||
|
|
||||||
| Say "Installation finished" | ||||||
| exit 0 | ||||||
| exit 0 | ||||||
Uh oh!
There was an error while loading. Please reload this page.