Fix global tool and SDK tests in release pipeline (#16342)
This commit is contained in:
parent
64392f36d1
commit
8fbffe3e4a
|
@ -97,6 +97,11 @@ jobs:
|
|||
|
||||
$toolPath = "$(System.DefaultWorkingDirectory)/toolPath/${{ parameters.globalToolExeName }}"
|
||||
|
||||
$env:DOTNET_ROOT = if ($IsWindows) { "$env:LOCALAPPDATA\Microsoft\dotnet" } else { "$env:HOME/.dotnet" }
|
||||
|
||||
Write-Verbose -Verbose "DOTNET_ROOT: $env:DOTNET_ROOT"
|
||||
Get-ChildItem $env:DOTNET_ROOT
|
||||
|
||||
$versionFound = & $toolPath -c '$PSVersionTable.PSVersion.ToString()'
|
||||
|
||||
if ( '$(PowerShellVersion)' -ne $versionFound)
|
||||
|
|
|
@ -8,6 +8,8 @@ jobs:
|
|||
displayName: ${{ parameters.displayName }}
|
||||
pool:
|
||||
vmImage: ${{ parameters.imageName }}
|
||||
variables:
|
||||
- group: AzDevOpsArtifacts
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
|
@ -35,6 +37,33 @@ jobs:
|
|||
artifact: metadata
|
||||
path: '$(Pipeline.Workspace)/releasePipeline/metadata'
|
||||
|
||||
- pwsh: |
|
||||
Import-Module "$(Build.SourcesDirectory)/build.psm1" -Force
|
||||
New-NugetConfigFile -NugetFeedUrl $(PSInternalNugetFeed) -UserName $(PSInternalNugetFeedUserName) -ClearTextPAT $(PSInternalNugetFeedPAT) -FeedName AzDevOpsFeed -Destination '$(Build.SourcesDirectory)/test/hosting'
|
||||
|
||||
Write-Verbose -Verbose "Capture hosting folder files"
|
||||
Get-ChildItem '$(Build.SourcesDirectory)/test/hosting'
|
||||
|
||||
# The above cmdlet creates a lower-case nuget.config. There also exists a NuGet.config which we needed to replace.
|
||||
# Hence the following workaround
|
||||
|
||||
if (-not $IsWindows) {
|
||||
Move-Item -Path '$(Build.SourcesDirectory)/test/hosting/nuget.config' -Destination '$(Build.SourcesDirectory)/test/hosting/NuGet.Config' -Force -ErrorAction Continue
|
||||
Write-Verbose -Verbose "Capture hosting folder files after Move-Item"
|
||||
Get-ChildItem '$(Build.SourcesDirectory)/test/hosting'
|
||||
}
|
||||
|
||||
if(-not (Test-Path "$(Build.SourcesDirectory)/test/hosting/NuGet.Config"))
|
||||
{
|
||||
throw "NuGet.Config is not created"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Verbose -Verbose "Capture NuGet.Config contents"
|
||||
Get-Content "$(Build.SourcesDirectory)/test/hosting/NuGet.Config" -Raw
|
||||
}
|
||||
displayName: Insert internal nuget feed
|
||||
|
||||
- pwsh: |
|
||||
$dotnetMetadataPath = "$(Build.SourcesDirectory)/DotnetRuntimeMetadata.json"
|
||||
$dotnetMetadataJson = Get-Content $dotnetMetadataPath -Raw | ConvertFrom-Json
|
||||
|
|
Loading…
Reference in a new issue