diff --git a/Common/Constants.cs b/Common/Constants.cs index 80753a440..0e269126c 100644 --- a/Common/Constants.cs +++ b/Common/Constants.cs @@ -50,10 +50,11 @@ public static class Constants public const string HostingStartHtml = "hostingstart.html"; - public const string KreDefaultVersion = "1.0.0-beta1"; + public const string KreDefaultVersion = "1.0.0-beta3"; public const string KreDefaultClr = "CLR"; public const string KreDefaultNugetApiUrl = "https://www.nuget.org/api/v2"; + // These should match the ones that are set by Azure public const string X64Bit = "AMD64"; public const string X86Bit = "x86"; diff --git a/Kudu.Core/Deployment/Generator/AspNet5Builder.cs b/Kudu.Core/Deployment/Generator/AspNet5Builder.cs index 3fe85002a..3943da261 100644 --- a/Kudu.Core/Deployment/Generator/AspNet5Builder.cs +++ b/Kudu.Core/Deployment/Generator/AspNet5Builder.cs @@ -4,6 +4,7 @@ using System.Text; using System.Threading.Tasks; using Kudu.Contracts.Settings; +using Kudu.Core.Infrastructure; namespace Kudu.Core.Deployment.Generator { @@ -15,6 +16,8 @@ public AspNet5Builder(IEnvironment environment, IDeploymentSettingsManager setti : base(environment, settings, propertyProvider, sourcePath) { _projectPath = projectPath; + var properties = propertyProvider.GetProperties(); + properties.Add(WellKnownEnvironmentVariables.KreVersion, AspNet5Helper.GetAspNet5RuntimeVersion(sourcePath)); } protected override string ScriptGeneratorCommandArguments diff --git a/Kudu.Core/Deployment/Generator/ExternalCommandFactory.cs b/Kudu.Core/Deployment/Generator/ExternalCommandFactory.cs index bfc9042b9..40c5d0f50 100644 --- a/Kudu.Core/Deployment/Generator/ExternalCommandFactory.cs +++ b/Kudu.Core/Deployment/Generator/ExternalCommandFactory.cs @@ -38,7 +38,6 @@ public Executable BuildExternalCommandExecutable(string workingDirectory, string UpdateToDefaultIfNotSet(exe, WellKnownEnvironmentVariables.SelectNodeVersionCommandKey, SelectNodeVersionCommand, logger); UpdateToDefaultIfNotSet(exe, WellKnownEnvironmentVariables.SelectPythonVersionCommandKey, SelectPythonVersionCommand, logger); UpdateToDefaultIfNotSet(exe, WellKnownEnvironmentVariables.WebJobsDeployCommandKey, WebJobsDeployCommand, logger); - UpdateToDefaultIfNotSet(exe, WellKnownEnvironmentVariables.KreVersion, Constants.KreDefaultVersion, logger); UpdateToDefaultIfNotSet(exe, WellKnownEnvironmentVariables.KreClr, Constants.KreDefaultClr, logger); UpdateToDefaultIfNotSet(exe, WellKnownEnvironmentVariables.KreBitness, KreBitness, logger); UpdateToDefaultIfNotSet(exe, WellKnownEnvironmentVariables.KreNugetApiUrl, Constants.KreDefaultNugetApiUrl, logger); @@ -168,9 +167,9 @@ private static string KreBitness var bitness = System.Environment.GetEnvironmentVariable(WellKnownEnvironmentVariables.SiteBitness); if (bitness == null) { - return System.Environment.Is64BitProcess ? "amd64" : "x86"; + return System.Environment.Is64BitProcess ? "x64" : "x86"; } - return bitness.Equals(Constants.X64Bit, StringComparison.OrdinalIgnoreCase) ? "amd64" : "x86"; + return bitness.Equals(Constants.X64Bit, StringComparison.OrdinalIgnoreCase) ? "x64" : "x86"; } } diff --git a/Kudu.Core/Infrastructure/AspNet5Helper.cs b/Kudu.Core/Infrastructure/AspNet5Helper.cs index a3f1dd863..0990af0ff 100644 --- a/Kudu.Core/Infrastructure/AspNet5Helper.cs +++ b/Kudu.Core/Infrastructure/AspNet5Helper.cs @@ -24,10 +24,29 @@ public static bool IsWebApplicationProjectJsonFile(string projectJsonPath) } } - public static bool TryAspNet5Project(string projectDirectory, out string projectJsonPath) + public static string GetAspNet5RuntimeVersion(string rootPath) + { + var runtimeVersion = Constants.KreDefaultVersion; + var globalJson = Path.Combine(rootPath, "global.json"); + if (File.Exists(globalJson)) + { + using (var reader = new StreamReader(globalJson)) + { + var parsedGlobalJson = JObject.Parse(reader.ReadToEnd()); + if (parsedGlobalJson["sdk"] != null && + parsedGlobalJson["sdk"]["version"] != null) + { + runtimeVersion = parsedGlobalJson["sdk"]["version"].ToString(); + } + } + } + return runtimeVersion; + } + + public static bool TryAspNet5Project(string rootPath, out string projectJsonPath) { projectJsonPath = null; - var projectJsonFiles = Directory.GetFiles(projectDirectory, "project.json", SearchOption.AllDirectories); + var projectJsonFiles = Directory.GetFiles(rootPath, "project.json", SearchOption.AllDirectories); foreach (var filePath in projectJsonFiles.Where(IsWebApplicationProjectJsonFile)) { projectJsonPath = filePath; diff --git a/Kudu.Core/Scripts/kvm.ps1 b/Kudu.Core/Scripts/kvm.ps1 index 856f2f019..d26a84ce0 100644 --- a/Kudu.Core/Scripts/kvm.ps1 +++ b/Kudu.Core/Scripts/kvm.ps1 @@ -3,35 +3,63 @@ param( [string] $Command, [string] $Proxy, [switch] $Verbosity = $false, - [alias("g")][switch] $Global = $false, [alias("p")][switch] $Persistent = $false, [alias("f")][switch] $Force = $false, [alias("r")][string] $Runtime, + + [alias("arch")][string] $Architecture, [switch] $X86 = $false, - [switch] $Amd64 = $false, - #deprecated - [switch] $X64 = $false, - #deprecated - [switch] $Svr50 = $false, - #deprecated - [switch] $Svrc50 = $false, + [alias("amd64")][switch] $X64 = $false, + [alias("w")][switch] $Wait = $false, [alias("a")] [string] $Alias = $null, [switch] $NoNative = $false, [parameter(Position=1, ValueFromRemainingArguments=$true)] - [string[]]$Args=@() + [string[]]$Args=@(), + [switch] $Quiet, + [string] $OutputVariable, + [switch] $AssumeElevated ) +# Constants +Set-Variable -Option Constant "BuildNumber" "10319" +Set-Variable -Option Constant "RuntimePackageName" "kre" +Set-Variable -Option Constant "RuntimeFriendlyName" "K Runtime" +Set-Variable -Option Constant "RuntimeShortName" "KRE" +Set-Variable -Option Constant "RuntimeFolderName" ".k" +Set-Variable -Option Constant "CommandName" "kvm" +Set-Variable -Option Constant "VersionManagerName" "K Version Manager" +Set-Variable -Option Constant "DefaultFeed" "https://www.nuget.org/api/v2" +Set-Variable -Option Constant "CrossGenCommand" "k-crossgen" +Set-Variable -Option Constant "HomeEnvVar" "KRE_HOME" +Set-Variable -Option Constant "UserHomeEnvVar" "KRE_USER_HOME" +Set-Variable -Option Constant "FeedEnvVar" "KRE_FEED" + + $selectedArch=$null; $defaultArch="x86" $selectedRuntime=$null -$defaultRuntime="CLR" -$userKrePath = $env:USERPROFILE + "\.kre" -$userKrePackages = $userKrePath + "\packages" -$globalKrePath = $env:ProgramFiles + "\KRE" -$globalKrePackages = $globalKrePath + "\packages" -$feed = $env:KRE_NUGET_API_URL +$defaultRuntime="clr" + +function getenv($name) { + if(Test-Path "env:\$name") { + cat "env:\$name" + } +} + +# Get or calculate userHome +$userHome = (getenv $UserHomeEnvVar) +if(!$userHome) { $userHome = $env:USERPROFILE + "\$RuntimeFolderName" } +$userRuntimesPath = $userHome + "\runtimes" + +# Get the feed from the environment variable or set it to the default value +$feed = (getenv $FeedEnvVar) +if (!$feed) +{ + $feed = $DefaultFeed; +} +$feed = $feed.TrimEnd("/") # In some environments, like Azure Websites, the Write-* cmdlets don't work $useHostOutputMethods = $true @@ -40,129 +68,116 @@ function String-IsEmptyOrWhitespace([string]$str) { return [string]::IsNullOrEmpty($str) -or $str.Trim().length -eq 0 } -if (!$feed) -{ - $feed = "https://www.nuget.org/api/v2"; -} - $scriptPath = $myInvocation.MyCommand.Definition -function Kvm-Help { +function _Help { @" -K Runtime Environment Version Manager - Build 3de6097964e51fe32c5f16c5a8e1e11e13dcd913 +$VersionManagerName - Build $BuildNumber -USAGE: kvm [options] +USAGE: $CommandName [options] -kvm upgrade [-X86][-Amd64] [-r|-Runtime CLR|CoreCLR] [-g|-Global] [-f|-Force] [-Proxy
] [-NoNative] - install latest KRE from feed +$CommandName upgrade [-X86|-X64] [-r|-Runtime CLR|CoreCLR] [-g|-Global] [-f|-Force] [-Proxy
] [-NoNative] + install latest $RuntimeShortName from feed set 'default' alias to installed version - add KRE bin to user PATH environment variable + add $RuntimeShortName bin to user PATH environment variable -g|-Global install to machine-wide location -f|-Force upgrade even if latest is already installed - -Proxy
use given address as proxy when accessing remote server + -Proxy
use given address as proxy when accessing remote server (e.g. https://username:password@proxyserver:8080/). Alternatively set proxy using http_proxy environment variable. -NoNative Do not generate native images (Effective only for CoreCLR flavors) -kvm install |||latest [-X86][-Amd64] [-r|-Runtime CLR|CoreCLR] [-a|-Alias ] [-g|-Global] [-f|-Force] [-NoNative] - | install requested KRE from feed - install requested KRE from package on local filesystem - latest install latest KRE from feed - add KRE bin to path of current command line - -p|-Persistent add KRE bin to PATH environment variables persistently - -a|-Alias set alias for requested KRE on install - -g|-Global install to machine-wide location +$CommandName install |||latest [-X86|-X64] [-r|-Runtime CLR|CoreCLR] [-a|-Alias ] [-f|-Force] [-Proxy
] [-NoNative] + | install requested $RuntimeShortName from feed + install requested $RuntimeShortName from package on local filesystem + latest install latest $RuntimeShortName from feed + add $RuntimeShortName bin to path of current command line + -p|-Persistent add $RuntimeShortName bin to PATH environment variables persistently + -a|-Alias set alias for requested $RuntimeShortName on install -f|-Force install even if specified version is already installed + -Proxy
use given address as proxy when accessing remote server (e.g. https://username:password@proxyserver:8080/). Alternatively set proxy using http_proxy environment variable. -NoNative Do not generate native images (Effective only for CoreCLR flavors) -kvm use |||none [-X86][-Amd64] [-r|-Runtime CLR|CoreCLR] [-p|-Persistent] [-g|-Global] - || add KRE bin to path of current command line - none remove KRE bin from path of current command line - -p|-Persistent add KRE bin to PATH environment variables persistently - -g|-Global combined with -p to change machine PATH instead of user PATH +$CommandName use |||none [-X86|-X64] [-r|-Runtime CLR|CoreCLR] [-p|-Persistent] + || add $RuntimeShortName bin to path of current command line + none remove $RuntimeShortName bin from path of current command line + -p|-Persistent add $RuntimeShortName bin to PATH environment variable across all processes run by the current user -kvm list - list KRE versions installed +$CommandName list + list $RuntimeShortName versions installed -kvm alias - list KRE aliases which have been defined +$CommandName alias + list $RuntimeShortName aliases which have been defined -kvm alias +$CommandName alias display value of the specified alias -kvm alias || [-X86][-Amd64] [-r|-Runtime CLR|CoreCLR] +$CommandName alias || [-X86|-X64] [-r|-Runtime CLR|CoreCLR] the name of the alias to set - || the KRE version to set the alias to. Alternatively use the version of the specified alias + || the $RuntimeShortName version to set the alias to. Alternatively use the version of the specified alias -kvm unalias +$CommandName unalias remove the specified alias "@ -replace "`n","`r`n" | Console-Write } -function Kvm-Global-Setup { - $kvmBinPath = "$userKrePath\bin" +function _Global-Setup { + # Sets up the version manager tool and adds the user-local runtime install directory to the home variable + # Note: We no longer do global install via this tool. The MSI handles global install of runtimes AND will set + # the machine level home value. + + # In this configuration, the user-level path will OVERRIDE the global path because it is placed first. + + $cmdBinPath = "$userHome\bin" If (Needs-Elevation) { - $arguments = "-ExecutionPolicy unrestricted & '$scriptPath' setup -global -wait" + $arguments = "-ExecutionPolicy unrestricted & '$scriptPath' setup -wait" Start-Process "$psHome\powershell.exe" -Verb runAs -ArgumentList $arguments -Wait - Console-Write "Adding $kvmBinPath to process PATH" - Set-Path (Change-Path $env:Path $kvmBinPath ($kvmBinPath)) - Console-Write "Adding $globalKrePath;%USERPROFILE%\.kre to process KRE_HOME" - $envKreHome = $env:KRE_HOME - $envKreHome = Change-Path $envKreHome "%USERPROFILE%\.kre" ("%USERPROFILE%\.kre") - $envKreHome = Change-Path $envKreHome $globalKrePath ($globalKrePath) - $env:KRE_HOME = $envKreHome + Console-Write "Adding $cmdBinPath to process PATH" + Set-Path (Change-Path $env:Path $cmdBinPath ($cmdBinPath)) + Console-Write "Adding %USERPROFILE%\$RuntimeFolderName to process $HomeEnvVar" + $envRuntimeHome = (getenv $HomeEnvVar) + $envRuntimeHome = Change-Path $envRuntimeHome "%USERPROFILE%\$RuntimeFolderName" ("%USERPROFILE%\$RuntimeFolderName") + Set-Content "env:\$HomeEnvVar" $envRuntimeHome Console-Write "Setup complete" break } $scriptFolder = [System.IO.Path]::GetDirectoryName($scriptPath) - Console-Write "Copying file $kvmBinPath\kvm.ps1" - md $kvmBinPath -Force | Out-Null - copy "$scriptFolder\kvm.ps1" "$kvmBinPath\kvm.ps1" + Console-Write "Copying file $cmdBinPath\$CommandName.ps1" + md $cmdBinPath -Force | Out-Null + copy "$scriptFolder\$CommandName.ps1" "$cmdBinPath\$CommandName.ps1" - Console-Write "Copying file $kvmBinPath\kvm.cmd" - copy "$scriptFolder\kvm.cmd" "$kvmBinPath\kvm.cmd" + Console-Write "Copying file $cmdBinPath\$CommandName.cmd" + copy "$scriptFolder\$CommandName.cmd" "$cmdBinPath\$CommandName.cmd" - Console-Write "Adding $kvmBinPath to process PATH" - Set-Path (Change-Path $env:Path $kvmBinPath ($kvmBinPath)) + Console-Write "Adding $cmdBinPath to process PATH" + Set-Path (Change-Path $env:Path $cmdBinPath ($cmdBinPath)) - Console-Write "Adding $kvmBinPath to user PATH" + Console-Write "Adding $cmdBinPath to user PATH" $userPath = [Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User) - $userPath = Change-Path $userPath $kvmBinPath ($kvmBinPath) + $userPath = Change-Path $userPath $cmdBinPath ($cmdBinPath) [Environment]::SetEnvironmentVariable("Path", $userPath, [System.EnvironmentVariableTarget]::User) - Console-Write "Adding $globalKrePath;%USERPROFILE%\.kre to process KRE_HOME" - $envKreHome = $env:KRE_HOME - $envKreHome = Change-Path $envKreHome "%USERPROFILE%\.kre" ("%USERPROFILE%\.kre") - $envKreHome = Change-Path $envKreHome $globalKrePath ($globalKrePath) - $env:KRE_HOME = $envKreHome - - Console-Write "Adding $globalKrePath;%USERPROFILE%\.kre to machine KRE_HOME" - $machineKreHome = [Environment]::GetEnvironmentVariable("KRE_HOME", [System.EnvironmentVariableTarget]::Machine) - $machineKreHome = Change-Path $machineKreHome "%USERPROFILE%\.kre" ("%USERPROFILE%\.kre") - $machineKreHome = Change-Path $machineKreHome $globalKrePath ($globalKrePath) - [Environment]::SetEnvironmentVariable("KRE_HOME", $machineKreHome, [System.EnvironmentVariableTarget]::Machine) -} + Console-Write "Adding %USERPROFILE%\$RuntimeFolderName to process $HomeEnvVar" + $envRuntimeHome = (getenv $HomeEnvVar) + $envRuntimeHome = Change-Path $envRuntimeHome "%USERPROFILE%\$RuntimeFolderName" ("%USERPROFILE%\$RuntimeFolderName") + Set-Content "env:\$HomeEnvVar" $envRuntimeHome -function Kvm-Global-Upgrade { - $Persistent = $true - $Alias="default" - $versionOrAlias = Kvm-Find-Latest $selectedRuntime $selectedArch - If (Needs-Elevation) { - $arguments = "-ExecutionPolicy unrestricted & '$scriptPath' install '$versionOrAlias' -global $(Requested-Switches) -wait" - Start-Process "$psHome\powershell.exe" -Verb runAs -ArgumentList $arguments -Wait - Kvm-Set-Global-Process-Path $versionOrAlias - break - } - Kvm-Install $versionOrAlias $true + Console-Write "Adding %USERPROFILE%\$RuntimeFolderName to machine $HomeEnvVar" + $machineruntimeHome = [Environment]::GetEnvironmentVariable($HomeEnvVar, [System.EnvironmentVariableTarget]::Machine) + $machineruntimeHome = Change-Path $machineruntimeHome "%USERPROFILE%\$RuntimeFolderName" ("%USERPROFILE%\$RuntimeFolderName") + [Environment]::SetEnvironmentVariable($HomeEnvVar, $machineruntimeHome, [System.EnvironmentVariableTarget]::Machine) } -function Kvm-Upgrade { +function _Upgrade { +param( + [boolean] $isGlobal +) $Persistent = $true $Alias="default" - Kvm-Install "latest" $false + _Install "latest" $isGlobal } function Add-Proxy-If-Specified { @@ -184,215 +199,208 @@ param( } } -function Kvm-Find-Latest { +function _Find-Latest { param( [string] $platform, [string] $architecture ) Console-Write "Determining latest version" - $url = "$feed/GetUpdates()?packageIds=%27KRE-$platform-$architecture%27&versions=%270.0%27&includePrerelease=true&includeAllVersions=false" + $url = "$feed/GetUpdates()?packageIds=%27$RuntimePackageName-$platform-win-$architecture%27&versions=%270.0%27&includePrerelease=true&includeAllVersions=false" $wc = New-Object System.Net.WebClient - $wc.Credentials = new-object System.Net.NetworkCredential("aspnetreadonly", "4d8a2d9c-7b80-4162-9978-47e918c9658c") Add-Proxy-If-Specified($wc) + Write-Verbose "Downloading $url ..." [xml]$xml = $wc.DownloadString($url) $version = Select-Xml "//d:Version" -Namespace @{d='http://schemas.microsoft.com/ado/2007/08/dataservices'} $xml if (String-IsEmptyOrWhitespace($version)) { - throw "There are no packages for platform '$platform', architecture '$architecture' in the feed '$feed'" + throw "There are no runtimes for platform '$platform', architecture '$architecture' in the feed '$feed'" } return $version } -function Do-Kvm-Download { +function Do-Download { param( - [string] $kreFullName, - [string] $packagesFolder + [string] $runtimeFullName, + [string] $runtimesFolder ) - $parts = $kreFullName.Split(".", 2) + $parts = $runtimeFullName.Split(".", 2) $url = "$feed/package/" + $parts[0] + "/" + $parts[1] - $kreFolder = Join-Path $packagesFolder $kreFullName - $kreFile = Join-Path $kreFolder "$kreFullName.nupkg" + $runtimeFolder = Join-Path $runtimesFolder $runtimeFullName + $runtimeFile = Join-Path $runtimeFolder "$runtimeFullName.nupkg" - If (Test-Path $kreFolder) { + If (Test-Path $runtimeFolder) { if($Force) { - rm $kreFolder -Recurse -Force + rm $runtimeFolder -Recurse -Force } else { - Console-Write "$kreFullName already installed." + Console-Write "$runtimeFullName already installed." return; } } - Console-Write "Downloading $kreFullName from $feed" + Console-Write "Downloading $runtimeFullName from $feed" #Downloading to temp location - $kreTempDownload = Join-Path $packagesFolder "temp" - $tempKreFile = Join-Path $kreTempDownload "$kreFullName.nupkg" + $runtimeTempDownload = Join-Path $runtimesFolder "temp" + $tempDownloadFile = Join-Path $runtimeTempDownload "$runtimeFullName.nupkg" - if(Test-Path $kreTempDownload) { - del "$kreTempDownload\*" -recurse + if(Test-Path $runtimeTempDownload) { + del "$runtimeTempDownload\*" -recurse } else { - md $kreTempDownload -Force | Out-Null + md $runtimeTempDownload -Force | Out-Null } $wc = New-Object System.Net.WebClient - $wc.Credentials = new-object System.Net.NetworkCredential("aspnetreadonly", "4d8a2d9c-7b80-4162-9978-47e918c9658c") Add-Proxy-If-Specified($wc) - $wc.DownloadFile($url, $tempKreFile) + Write-Verbose "Downloading $url ..." + $wc.DownloadFile($url, $tempDownloadFile) - Do-Kvm-Unpack $tempKreFile $kreTempDownload + Do-Unpack $tempDownloadFile $runtimeTempDownload - md $kreFolder -Force | Out-Null - Console-Write "Installing to $kreFolder" - mv "$kreTempDownload\*" $kreFolder - Remove-Item "$kreTempDownload" -Force | Out-Null + md $runtimeFolder -Force | Out-Null + Console-Write "Installing to $runtimeFolder" + mv "$runtimeTempDownload\*" $runtimeFolder + Remove-Item "$runtimeTempDownload" -Force | Out-Null } -function Do-Kvm-Unpack { +function Do-Unpack { param( - [string] $kreFile, - [string] $kreFolder + [string] $runtimeFile, + [string] $runtimeFolder ) - Console-Write "Unpacking to $kreFolder" + Console-Write "Unpacking to $runtimeFolder" $compressionLib = [System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') - + if($compressionLib -eq $null) { try { # Shell will not recognize nupkg as a zip and throw, so rename it to zip - $kreZip = [System.IO.Path]::ChangeExtension($kreFile, "zip") - Rename-Item $kreFile $kreZip + $runtimeZip = [System.IO.Path]::ChangeExtension($runtimeFile, "zip") + Rename-Item $runtimeFile $runtimeZip # Use the shell to uncompress the nupkg $shell_app=new-object -com shell.application - $zip_file = $shell_app.namespace($kreZip) - $destination = $shell_app.namespace($kreFolder) + $zip_file = $shell_app.namespace($runtimeZip) + $destination = $shell_app.namespace($runtimeFolder) $destination.Copyhere($zip_file.items(), 0x14) #0x4 = don't show UI, 0x10 = overwrite files } finally { # make it a nupkg again - Rename-Item $kreZip $kreFile + Rename-Item $runtimeZip $runtimeFile } } else { - [System.IO.Compression.ZipFile]::ExtractToDirectory($kreFile, $kreFolder) + [System.IO.Compression.ZipFile]::ExtractToDirectory($runtimeFile, $runtimeFolder) } - If (Test-Path ($kreFolder + "\[Content_Types].xml")) { - Remove-Item ($kreFolder + "\[Content_Types].xml") + If (Test-Path ($runtimeFolder + "\[Content_Types].xml")) { + Remove-Item ($runtimeFolder + "\[Content_Types].xml") } - If (Test-Path ($kreFolder + "\_rels\")) { - Remove-Item ($kreFolder + "\_rels\") -Force -Recurse + If (Test-Path ($runtimeFolder + "\_rels\")) { + Remove-Item ($runtimeFolder + "\_rels\") -Force -Recurse } - If (Test-Path ($kreFolder + "\package\")) { - Remove-Item ($kreFolder + "\package\") -Force -Recurse + If (Test-Path ($runtimeFolder + "\package\")) { + Remove-Item ($runtimeFolder + "\package\") -Force -Recurse } + + # Clean up the package file itself. + Remove-Item $runtimeFile -Force } -function Kvm-Install { +function _Install { param( [string] $versionOrAlias, [boolean] $isGlobal ) if ($versionOrAlias -eq "latest") { - $versionOrAlias = Kvm-Find-Latest (Requested-Platform $defaultRuntime) (Requested-Architecture $defaultArch) + $versionOrAlias = _Find-Latest (Requested-Platform $defaultRuntime) (Requested-Architecture $defaultArch) } if ($versionOrAlias.EndsWith(".nupkg")) { - $kreFullName = [System.IO.Path]::GetFileNameWithoutExtension($versionOrAlias) + $runtimeFullName = [System.IO.Path]::GetFileNameWithoutExtension($versionOrAlias) } else { - $kreFullName = Requested-VersionOrAlias $versionOrAlias + $runtimeFullName = Requested-VersionOrAlias $versionOrAlias } - if ($isGlobal) { - if (Needs-Elevation) { - $arguments = "-ExecutionPolicy unrestricted & '$scriptPath' install '$versionOrAlias' -global $(Requested-Switches) -wait" - Start-Process "$psHome\powershell.exe" -Verb runAs -ArgumentList $arguments -Wait - Kvm-Set-Global-Process-Path $versionOrAlias - break - } - $packageFolder = $globalKrePackages - } else { - $packageFolder = $userKrePackages - } + $packageFolder = $userRuntimesPath if ($versionOrAlias.EndsWith(".nupkg")) { - Set-Variable -Name "selectedArch" -Value (Package-Arch $kreFullName) -Scope Script - Set-Variable -Name "selectedRuntime" -Value (Package-Platform $kreFullName) -Scope Script + Set-Variable -Name "selectedArch" -Value (Package-Arch $runtimeFullName) -Scope Script + Set-Variable -Name "selectedRuntime" -Value (Package-Platform $runtimeFullName) -Scope Script - $kreFolder = "$packageFolder\$kreFullName" - $folderExists = Test-Path $kreFolder + $runtimeFolder = "$packageFolder\$runtimeFullName" + $folderExists = Test-Path $runtimeFolder if ($folderExists -and $Force) { - del $kreFolder -Recurse -Force + del $runtimeFolder -Recurse -Force $folderExists = $false; } if ($folderExists) { - Console-Write "Target folder '$kreFolder' already exists" + Console-Write "Target folder '$runtimeFolder' already exists" } else { $tempUnpackFolder = Join-Path $packageFolder "temp" - $tempKreFile = Join-Path $tempUnpackFolder "$kreFullName.nupkg" + $tempDownloadFile = Join-Path $tempUnpackFolder "$runtimeFullName.nupkg" if(Test-Path $tempUnpackFolder) { del "$tempUnpackFolder\*" -recurse } else { md $tempUnpackFolder -Force | Out-Null } - copy $versionOrAlias $tempKreFile + copy $versionOrAlias $tempDownloadFile - Do-Kvm-Unpack $tempKreFile $tempUnpackFolder - md $kreFolder -Force | Out-Null - Console-Write "Installing to $kreFolder" - mv "$tempUnpackFolder\*" $kreFolder + Do-Unpack $tempDownloadFile $tempUnpackFolder + md $runtimeFolder -Force | Out-Null + Console-Write "Installing to $runtimeFolder" + mv "$tempUnpackFolder\*" $runtimeFolder Remove-Item "$tempUnpackFolder" -Force | Out-Null } - $packageVersion = Package-Version $kreFullName + $packageVersion = Package-Version $runtimeFullName - Kvm-Use $packageVersion + _Use $packageVersion if (!$(String-IsEmptyOrWhitespace($Alias))) { - Kvm-Alias-Set $Alias $packageVersion + _Alias-Set $Alias $packageVersion } } else { - Do-Kvm-Download $kreFullName $packageFolder - Kvm-Use $versionOrAlias + Do-Download $runtimeFullName $packageFolder + _Use $versionOrAlias if (!$(String-IsEmptyOrWhitespace($Alias))) { - Kvm-Alias-Set "$Alias" $versionOrAlias + _Alias-Set "$Alias" $versionOrAlias } } - if ($kreFullName.Contains("CoreCLR")) { + if ($runtimeFullName.Contains("CoreCLR")) { if ($NoNative) { Console-Write "Native image generation is skipped" } else { - Console-Write "Compiling native images for $kreFullName to improve startup performance..." - Start-Process "K" -ArgumentList "crossgen" -Wait + Console-Write "Compiling native images for $runtimeFullName to improve startup performance..." + Start-Process $CrossGenCommand -Wait Console-Write "Finished native image compilation." } } } -function Kvm-List { - $kreHome = $env:KRE_HOME - if (!$kreHome) { - $kreHome = "$globalKrePath;$userKrePath" +function _List { + $runtimeHome = (getenv $HomeEnvVar) + if (!$runtimeHome) { + $runtimeHome = "$userHome" } - md ($userKrePath + "\alias\") -Force | Out-Null - $aliases = Get-ChildItem ($userKrePath + "\alias\") | Select @{label='Alias';expression={$_.BaseName}}, @{label='Name';expression={Get-Content $_.FullName }} + md ($userHome + "\alias\") -Force | Out-Null + $aliases = Get-ChildItem ($userHome + "\alias\") | Select @{label='Alias';expression={$_.BaseName}}, @{label='Name';expression={Get-Content $_.FullName }} $items = @() - foreach($portion in $kreHome.Split(';')) { + foreach($portion in $runtimeHome.Split(';')) { $path = [System.Environment]::ExpandEnvironmentVariables($portion) - if (Test-Path("$path\packages")) { - $items += Get-ChildItem ("$path\packages\KRE-*") | List-Parts $aliases + if (Test-Path("$path\runtimes")) { + $items += Get-ChildItem ("$path\runtimes\$RuntimePackageName-*") | List-Parts $aliases } } @@ -427,173 +435,116 @@ filter List-Parts { } $parts1 = $_.Name.Split('.', 2) - $parts2 = $parts1[0].Split('-', 3) + $parts2 = $parts1[0].Split('-', 4) return New-Object PSObject -Property @{ Active = if ($active) { "*" } else { "" } Version = $parts1[1] Runtime = $parts2[1] - Architecture = $parts2[2] + OperatingSystem = $parts2[2] + Architecture = $parts2[3] Location = $_.Parent.FullName Alias = $fullAlias } } -function Kvm-Global-Use { -param( - [string] $versionOrAlias -) - Validate-Full-Package-Name-Arguments-Combination $versionOrAlias - - If (Needs-Elevation) { - $arguments = "-ExecutionPolicy unrestricted & '$scriptPath' use '$versionOrAlias' -global $(Requested-Switches) -wait" - Start-Process "$psHome\powershell.exe" -Verb runAs -ArgumentList $arguments -Wait - Kvm-Set-Global-Process-Path $versionOrAlias - break - } - - Kvm-Set-Global-Process-Path "$versionOrAlias" - - if ($versionOrAlias -eq "none") { - if ($Persistent) { - Console-Write "Removing KRE from machine PATH" - $machinePath = [Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine) - $machinePath = Change-Path $machinePath "" ($globalKrePackages, $userKrePackages) - [Environment]::SetEnvironmentVariable("Path", $machinePath, [System.EnvironmentVariableTarget]::Machine) - } - return; - } - - $kreFullName = Requested-VersionOrAlias "$versionOrAlias" - $kreBin = Locate-KreBinFromFullName $kreFullName - if ($kreBin -eq $null) { - throw "Cannot find $kreFullName, do you need to run 'kvm install $versionOrAlias'?" - } - - if ($Persistent) { - Console-Write "Adding $kreBin to machine PATH" - $machinePath = [Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine) - $machinePath = Change-Path $machinePath $kreBin ($globalKrePackages, $userKrePackages) - [Environment]::SetEnvironmentVariable("Path", $machinePath, [System.EnvironmentVariableTarget]::Machine) - } -} - -function Kvm-Set-Global-Process-Path { -param( - [string] $versionOrAlias -) - if ($versionOrAlias -eq "none") { - Console-Write "Removing KRE from process PATH" - Set-Path (Change-Path $env:Path "" ($globalKrePackages, $userKrePackages)) - return - } - - $kreFullName = Requested-VersionOrAlias $versionOrAlias - $kreBin = Locate-KreBinFromFullName $kreFullName - if ($kreBin -eq $null) { - Console-Write "Cannot find $kreFullName, do you need to run 'kvm install $versionOrAlias'?" - return - } - - Console-Write "Adding $kreBin to process PATH" - Set-Path (Change-Path $env:Path $kreBin ($globalKrePackages, $userKrePackages)) -} - -function Kvm-Use { +function _Use { param( [string] $versionOrAlias ) Validate-Full-Package-Name-Arguments-Combination $versionOrAlias if ($versionOrAlias -eq "none") { - Console-Write "Removing KRE from process PATH" - Set-Path (Change-Path $env:Path "" ($globalKrePackages, $userKrePackages)) + Console-Write "Removing $RuntimeShortName from process PATH" + Set-Path (Change-Path $env:Path "" ($userRuntimesPath)) if ($Persistent) { - Console-Write "Removing KRE from user PATH" + Console-Write "Removing $RuntimeShortName from user PATH" $userPath = [Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User) - $userPath = Change-Path $userPath "" ($globalKrePackages, $userKrePackages) + $userPath = Change-Path $userPath "" ($userRuntimesPath) [Environment]::SetEnvironmentVariable("Path", $userPath, [System.EnvironmentVariableTarget]::User) } return; } - $kreFullName = Requested-VersionOrAlias $versionOrAlias + $runtimeFullName = Requested-VersionOrAlias $versionOrAlias - $kreBin = Locate-KreBinFromFullName $kreFullName - if ($kreBin -eq $null) { - throw "Cannot find $kreFullName, do you need to run 'kvm install $versionOrAlias'?" + $runtimeBin = Locate-RuntimeBinFromFullName $runtimeFullName + if ($runtimeBin -eq $null) { + throw "Cannot find $runtimeFullName, do you need to run '$CommandName install $versionOrAlias'?" } - Console-Write "Adding $kreBin to process PATH" - Set-Path (Change-Path $env:Path $kreBin ($globalKrePackages, $userKrePackages)) + Console-Write "Adding $runtimeBin to process PATH" + Set-Path (Change-Path $env:Path $runtimeBin ($userRuntimesPath)) if ($Persistent) { - Console-Write "Adding $kreBin to user PATH" + Console-Write "Adding $runtimeBin to user PATH" $userPath = [Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User) - $userPath = Change-Path $userPath $kreBin ($globalKrePackages, $userKrePackages) + $userPath = Change-Path $userPath $runtimeBin ($userRuntimesPath) [Environment]::SetEnvironmentVariable("Path", $userPath, [System.EnvironmentVariableTarget]::User) } } -function Kvm-Alias-List { - md ($userKrePath + "\alias\") -Force | Out-Null +function _Alias-List { + md ($userHome + "\alias\") -Force | Out-Null - Get-ChildItem ($userKrePath + "\alias\") | Select @{label='Alias';expression={$_.BaseName}}, @{label='Name';expression={Get-Content $_.FullName }} | Format-Table -AutoSize + Get-ChildItem ($userHome + "\alias\") | Select @{label='Alias';expression={$_.BaseName}}, @{label='Name';expression={Get-Content $_.FullName }} | Format-Table -AutoSize } -function Kvm-Alias-Get { +function _Alias-Get { param( [string] $name ) - md ($userKrePath + "\alias\") -Force | Out-Null - $aliasFilePath=$userKrePath + "\alias\" + $name + ".txt" + md ($userHome + "\alias\") -Force | Out-Null + $aliasFilePath=$userHome + "\alias\" + $name + ".txt" if (!(Test-Path $aliasFilePath)) { Console-Write "Alias '$name' does not exist" + $script:exitCode = 1 # Return non-zero exit code for scripting } else { - $aliasValue = (Get-Content ($userKrePath + "\alias\" + $name + ".txt")) - Console-Write "Alias '$name' is set to $aliasValue" + $aliasValue = (Get-Content ($userHome + "\alias\" + $name + ".txt")) + Console-Write "Alias '$name' is set to $aliasValue" } } -function Kvm-Alias-Set { +function _Alias-Set { param( [string] $name, [string] $value ) - $kreFullName = Requested-VersionOrAlias $value - $aliasFilePath = $userKrePath + "\alias\" + $name + ".txt" + $runtimeFullName = Requested-VersionOrAlias $value + $aliasFilePath = $userHome + "\alias\" + $name + ".txt" $action = if (Test-Path $aliasFilePath) { "Updating" } else { "Setting" } - Console-Write "$action alias '$name' to '$kreFullName'" - md ($userKrePath + "\alias\") -Force | Out-Null - $kreFullName | Out-File ($aliasFilePath) ascii + Console-Write "$action alias '$name' to '$runtimeFullName'" + md ($userHome + "\alias\") -Force | Out-Null + $runtimeFullName | Out-File ($aliasFilePath) ascii } -function Kvm-Unalias { +function _Unalias { param( [string] $name ) - $aliasPath=$userKrePath + "\alias\" + $name + ".txt" + $aliasPath=$userHome + "\alias\" + $name + ".txt" if (Test-Path -literalPath "$aliasPath") { Console-Write "Removing alias $name" Remove-Item -literalPath $aliasPath } else { Console-Write "Cannot remove alias, '$name' is not a valid alias name" + $script:exitCode = 1 # Return non-zero exit code for scripting } } -function Locate-KreBinFromFullName() { +function Locate-RuntimeBinFromFullName() { param( - [string] $kreFullName + [string] $runtimeFullName ) - $kreHome = $env:KRE_HOME - if (!$kreHome) { - $kreHome = "$globalKrePath;$userKrePath" + $runtimeHome = (getenv $HomeEnvVar) + if (!$runtimeHome) { + $runtimeHome = $userHome } - foreach($portion in $kreHome.Split(';')) { + foreach($portion in $runtimeHome.Split(';')) { $path = [System.Environment]::ExpandEnvironmentVariables($portion) - $kreBin = "$path\packages\$kreFullName\bin" - if (Test-Path "$kreBin") { - return $kreBin + $runtimeBin = "$path\runtimes\$runtimeFullName\bin" + if (Test-Path "$runtimeBin") { + return $runtimeBin } } return $null @@ -601,23 +552,23 @@ param( function Package-Version() { param( - [string] $kreFullName + [string] $runtimeFullName ) - return $kreFullName -replace '[^.]*.(.*)', '$1' + return $runtimeFullName -replace '[^.]*.(.*)', '$1' } function Package-Platform() { param( - [string] $kreFullName + [string] $runtimeFullName ) - return $kreFullName -replace 'KRE-([^-]*).*', '$1' + return $runtimeFullName -replace "$RuntimePackageName-([^-]*).*", '$1' } function Package-Arch() { param( - [string] $kreFullName + [string] $runtimeFullName ) - return $kreFullName -replace 'KRE-[^-]*-([^.]*).*', '$1' + return $runtimeFullName -replace "$RuntimePackageName-[^-]*-[^-]*-([^.]*).*", '$1' } @@ -627,26 +578,28 @@ param( ) Validate-Full-Package-Name-Arguments-Combination $versionOrAlias - $kreBin = Locate-KreBinFromFullName $versionOrAlias + $runtimeBin = Locate-RuntimeBinFromFullName $versionOrAlias # If the name specified is an existing package, just use it as is - if ($kreBin -ne $null) { + if ($runtimeBin -ne $null) { return $versionOrAlias } - If (Test-Path ($userKrePath + "\alias\" + $versionOrAlias + ".txt")) { - $aliasValue = Get-Content ($userKrePath + "\alias\" + $versionOrAlias + ".txt") + If (Test-Path ($userHome + "\alias\" + $versionOrAlias + ".txt")) { + $aliasValue = Get-Content ($userHome + "\alias\" + $versionOrAlias + ".txt") + # Split runtime-coreclr-win-x86.1.0.0-beta3-10922 into version and name sections $parts = $aliasValue.Split('.', 2) $pkgVersion = $parts[1] - $parts =$parts[0].Split('-', 3) + # runtime-coreclr-win-x86 + $parts = $parts[0].Split('-', 4) $pkgPlatform = Requested-Platform $parts[1] - $pkgArchitecture = Requested-Architecture $parts[2] + $pkgArchitecture = Requested-Architecture $parts[3] } else { $pkgVersion = $versionOrAlias $pkgPlatform = Requested-Platform $defaultRuntime $pkgArchitecture = Requested-Architecture $defaultArch } - return "KRE-" + $pkgPlatform + "-" + $pkgArchitecture + "." + $pkgVersion + return $RuntimePackageName + "-" + $pkgPlatform + "-win-" + $pkgArchitecture + "." + $pkgVersion } function Requested-Platform() { @@ -675,7 +628,7 @@ param( foreach($portion in $existingPaths.Split(';')) { $skip = $portion -eq "" foreach($removePath in $removePaths) { - if ($portion.StartsWith($removePath)) { + if ($removePath -and ($portion.StartsWith($removePath))) { $skip = $true } } @@ -690,14 +643,18 @@ function Set-Path() { param( [string] $newPath ) - md $userKrePath -Force | Out-Null + md $userHome -Force | Out-Null $env:Path = $newPath @" SET "PATH=$newPath" -"@ | Out-File ($userKrePath + "\run-once.cmd") ascii +"@ | Out-File ($userHome + "\temp-set-envvars.cmd") ascii } function Needs-Elevation() { + if($AssumeElevated) { + return $false + } + $user = [Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent() $elevated = $user.IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") return -NOT $elevated @@ -706,8 +663,6 @@ function Needs-Elevation() { function Requested-Switches() { $arguments = "" if ($X86) {$arguments = "$arguments -x86"} - if ($Amd64) {$arguments = "$arguments -amd64"} - #deprecated if ($X64) {$arguments = "$arguments -x64"} if ($selectedRuntime) {$arguments = "$arguments -runtime $selectedRuntime"} if ($Persistent) {$arguments = "$arguments -persistent"} @@ -716,54 +671,58 @@ function Requested-Switches() { return $arguments } -function Validate-And-Santitise-Switches() +function Validate-And-Santitize-Switches() { - if ($Svr50 -and $Runtime) {throw "You cannot select both the -runtime switch and the -svr50 runtimes"} - if ($Svrc50 -and $Runtime) {throw "You cannot select both the -runtime switch and the -svrc50 runtimes"} - if ($X86 -and $Amd64) {throw "You cannot select both x86 and amd64 architectures"} if ($X86 -and $X64) {throw "You cannot select both x86 and x64 architectures"} - if ($X64 -and $Amd64) {throw "You cannot select both x64 and amd64 architectures"} if ($Runtime) { - $validRuntimes = "CoreCLR", "CLR", "svr50", "svrc50" + $validRuntimes = "CoreCLR", "CLR" $match = $validRuntimes | ? { $_ -like $Runtime } | Select -First 1 if (!$match) {throw "'$runtime' is not a valid runtime"} - Set-Variable -Name "selectedRuntime" -Value $match -Scope Script - } elseif ($Svr50) { - Console-Write "Warning: -svr50 is deprecated, use -runtime CLR for new packages." - Set-Variable -Name "selectedRuntime" -Value "svr50" -Scope Script - } elseif ($Svrc50) { - Console-Write "Warning: -svrc50 is deprecated, use -runtime CoreCLR for new packages." - Set-Variable -Name "selectedRuntime" -Value "svrc50" -Scope Script + Set-Variable -Name "selectedRuntime" -Value $match.ToLowerInvariant() -Scope Script } - if ($X64) { - Console-Write "Warning: -x64 is deprecated, use -amd64 for new packages." - Set-Variable -Name "selectedArch" -Value "x64" -Scope Script - } elseif ($Amd64) { - Set-Variable -Name "selectedArch" -Value "amd64" -Scope Script - } elseif ($X86) { - Set-Variable -Name "selectedArch" -Value "x86" -Scope Script + if($Architecture) { + $validArchitectures = "x64", "x86" + $match = $validArchitectures | ? { $_ -like $Architecture } | Select -First 1 + if(!$match) {throw "'$architecture' is not a valid architecture"} + Set-Variable -Name "selectedArch" -Value $match.ToLowerInvariant() -Scope Script + } + else { + if ($X64) { + Set-Variable -Name "selectedArch" -Value "x64" -Scope Script + } elseif ($X86) { + Set-Variable -Name "selectedArch" -Value "x86" -Scope Script + } } + } +$script:capturedOut = @() function Console-Write() { param( [Parameter(ValueFromPipeline=$true)] [string] $message ) - if ($useHostOutputMethods) { - try { - Write-Host $message + if($OutputVariable) { + # Update the capture output + $script:capturedOut += @($message) + } + + if(!$Quiet) { + if ($useHostOutputMethods) { + try { + Write-Host $message + } + catch { + $script:useHostOutputMethods = $false + Console-Write $message + } } - catch { - $script:useHostOutputMethods = $false - Console-Write $message + else { + [Console]::WriteLine($message) } } - else { - [Console]::WriteLine($message) - } } function Console-Write-Error() { @@ -782,55 +741,50 @@ param( } else { [Console]::Error.WriteLine($message) - } + } } function Validate-Full-Package-Name-Arguments-Combination() { param( - [string] $versionOrAlias + [string] $versionOrAlias ) - if ($versionOrAlias -like "KRE-*" -and - ($selectedArch -or $selectedRuntime)) { - throw "Runtime or architecture cannot be specified when using the full package name." + if ($versionOrAlias -like "$RuntimePackageName-*" -and + ($selectedArch -or $selectedRuntime)) { + throw "Runtime or architecture cannot be specified when using the full package name." } } -$exitCode = 0 +$script:exitCode = 0 try { - Validate-And-Santitise-Switches - if ($Global) { - switch -wildcard ($Command + " " + $Args.Count) { - "setup 0" {Kvm-Global-Setup} - "upgrade 0" {Kvm-Global-Upgrade} - "install 1" {Kvm-Install $Args[0] $true} - "use 1" {Kvm-Global-Use $Args[0]} - default {throw "Unknown command, or global switch not supported"}; - } - } else { - switch -wildcard ($Command + " " + $Args.Count) { - "setup 0" {Kvm-Global-Setup} - "upgrade 0" {Kvm-Upgrade} - "install 1" {Kvm-Install $Args[0] $false} - "list 0" {Kvm-List} - "use 1" {Kvm-Use $Args[0]} - "alias 0" {Kvm-Alias-List} - "alias 1" {Kvm-Alias-Get $Args[0]} - "alias 2" {Kvm-Alias-Set $Args[0] $Args[1]} - "unalias 1" {Kvm-Unalias $Args[0]} - "help 0" {Kvm-Help} - " 0" {Kvm-Help} - default {throw "Unknown command"}; - } + Validate-And-Santitize-Switches + switch -wildcard ($Command + " " + $Args.Count) { + "setup 0" {_Global-Setup} + "upgrade 0" {_Upgrade $false} + "install 1" {_Install $Args[0] $false} + "list 0" {_List} + "use 1" {_Use $Args[0]} + "alias 0" {_Alias-List} + "alias 1" {_Alias-Get $Args[0]} + "alias 2" {_Alias-Set $Args[0] $Args[1]} + "unalias 1" {_Unalias $Args[0]} + "help 0" {_Help} + " 0" {_Help} + default {throw "Unknown command"}; } } catch { Console-Write-Error $_ - Console-Write "Type 'kvm help' for help on how to use kvm." - $exitCode = -1 + Console-Write "Type '$CommandName help' for help on how to use $CommandName." + $script:exitCode = -1 } if ($Wait) { Console-Write "Press any key to continue ..." $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown,AllowCtrlC") } -exit $exitCode \ No newline at end of file +# If the user specified an output variable, push the value up to the parent scope +if($OutputVariable) { + Set-Variable $OutputVariable $script:capturedOut -Scope 1 +} + +exit $script:exitCode \ No newline at end of file diff --git a/Kudu.Services.Web/updateNodeModules.cmd b/Kudu.Services.Web/updateNodeModules.cmd index 3d21000df..263c30e51 100644 --- a/Kudu.Services.Web/updateNodeModules.cmd +++ b/Kudu.Services.Web/updateNodeModules.cmd @@ -10,7 +10,7 @@ set counter=0 set /a counter+=1 echo Attempt %counter% out of %attempts% -cmd /c npm install https://github.com/projectkudu/KuduScript/tarball/753f879db048fe67d48a56171e2398453a1627fb +cmd /c npm install https://github.com/projectkudu/KuduScript/tarball/642274789013a85b66b1eb3bf305562191735137 IF %ERRORLEVEL% NEQ 0 goto error goto end diff --git a/Kudu.TestHarness/TestRepositories.cs b/Kudu.TestHarness/TestRepositories.cs index c8073fc3e..509a6e04b 100644 --- a/Kudu.TestHarness/TestRepositories.cs +++ b/Kudu.TestHarness/TestRepositories.cs @@ -12,8 +12,8 @@ internal class TestRepositories new TestRepositoryInfo("git@github.com:KuduQAOrg/RepoWithPrivateSubModule.git", "4820516"), new TestRepositoryInfo("https://github.com/KuduApps/-benr-.git", "c553978"), new TestRepositoryInfo("https://github.com/KuduApps/AppWithPostBuildEvent.git", "083b651"), - new TestRepositoryInfo("https://github.com/KuduApps/AspNet5With2ProjectsAndSlnFile.git","fa2d024"), - new TestRepositoryInfo("https://github.com/KuduApps/AspNet5With2ProjectsNoSlnFile.git", "c2e9c28"), + new TestRepositoryInfo("https://github.com/KuduApps/AspNet5With2ProjectsAndSlnFile.git","6cb6a7e"), + new TestRepositoryInfo("https://github.com/KuduApps/AspNet5With2ProjectsNoSlnFile.git", "d56e439"), new TestRepositoryInfo("https://github.com/KuduApps/Bakery.git", "2f29dc6"), new TestRepositoryInfo("https://github.com/KuduApps/BasicConsoleWorker.git", "ce1ec74"), new TestRepositoryInfo("https://github.com/KuduApps/ConditionalCompilation.git", "a104578"),