[master] Update dependencies from dotnet/arcade (#7013)
* Update dependencies from https://github.com/dotnet/arcade build 20190618.2 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19318.2 * Update dependencies from https://github.com/dotnet/arcade build 20190619.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19319.1
This commit is contained in:
Родитель
b900968092
Коммит
66a209afac
|
@ -3,9 +3,9 @@
|
|||
<ProductDependencies>
|
||||
</ProductDependencies>
|
||||
<ToolsetDependencies>
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19315.2">
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19319.1">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>aa4285be7fab64e2b6e62e4d5688ea50931c407c</Sha>
|
||||
<Sha>209388b8a700bb99690ae7fbbabe7e55f1999a8f</Sha>
|
||||
</Dependency>
|
||||
</ToolsetDependencies>
|
||||
</Dependencies>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
@{
|
||||
IncludeRules=@('PSAvoidUsingCmdletAliases',
|
||||
'PSAvoidUsingWMICmdlet',
|
||||
'PSAvoidUsingPositionalParameters',
|
||||
'PSAvoidUsingInvokeExpression',
|
||||
'PSUseDeclaredVarsMoreThanAssignments',
|
||||
'PSUseCmdletCorrectly',
|
||||
'PSStandardDSCFunctionsInResource',
|
||||
'PSUseIdenticalMandatoryParametersForDSC',
|
||||
'PSUseIdenticalParametersForDSC')
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
param(
|
||||
[Parameter(Mandatory=$true)][string] $Operation,
|
||||
[string] $AuthToken,
|
||||
[string] $CommitSha,
|
||||
[string] $RepoName,
|
||||
[switch] $IsFeedPrivate
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
Set-StrictMode -Version 2.0
|
||||
|
||||
. $PSScriptRoot\tools.ps1
|
||||
|
||||
# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed
|
||||
# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in
|
||||
# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. This should ONLY be called from identified
|
||||
# internal builds
|
||||
function SetupCredProvider {
|
||||
param(
|
||||
[string] $AuthToken
|
||||
)
|
||||
|
||||
# Install the Cred Provider NuGet plugin
|
||||
Write-Host "Setting up Cred Provider NuGet plugin in the agent..."
|
||||
Write-Host "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..."
|
||||
|
||||
$url = 'https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1'
|
||||
|
||||
Write-Host "Writing the contents of 'installcredprovider.ps1' locally..."
|
||||
Invoke-WebRequest $url -OutFile installcredprovider.ps1
|
||||
|
||||
Write-Host "Installing plugin..."
|
||||
.\installcredprovider.ps1 -Force
|
||||
|
||||
Write-Host "Deleting local copy of 'installcredprovider.ps1'..."
|
||||
Remove-Item .\installcredprovider.ps1
|
||||
|
||||
if (-Not("$env:USERPROFILE\.nuget\plugins\netcore")) {
|
||||
Write-Host "CredProvider plugin was not installed correctly!"
|
||||
ExitWithExitCode 1
|
||||
}
|
||||
else {
|
||||
Write-Host "CredProvider plugin was installed correctly!"
|
||||
}
|
||||
|
||||
# Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable
|
||||
# feeds successfully
|
||||
|
||||
$nugetConfigPath = "$RepoRoot\NuGet.config"
|
||||
|
||||
if (-Not (Test-Path -Path $nugetConfigPath)) {
|
||||
Write-Host "NuGet.config file not found in repo's root!"
|
||||
ExitWithExitCode 1
|
||||
}
|
||||
|
||||
$endpoints = New-Object System.Collections.ArrayList
|
||||
$nugetConfigPackageSources = Select-Xml -Path $nugetConfigPath -XPath "//packageSources/add[contains(@key, 'darc-int-')]/@value" | foreach{$_.Node.Value}
|
||||
|
||||
if (($nugetConfigPackageSources | Measure-Object).Count -gt 0 ) {
|
||||
foreach ($stableRestoreResource in $nugetConfigPackageSources) {
|
||||
$trimmedResource = ([string]$stableRestoreResource).Trim()
|
||||
[void]$endpoints.Add(@{endpoint="$trimmedResource"; password="$AuthToken"})
|
||||
}
|
||||
}
|
||||
|
||||
if (($endpoints | Measure-Object).Count -gt 0) {
|
||||
# Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}'
|
||||
$endpointCredentials = @{endpointCredentials=$endpoints} | ConvertTo-Json -Compress
|
||||
|
||||
# Create the environment variables the AzDo way
|
||||
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $endpointCredentials -Properties @{
|
||||
'variable' = 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS'
|
||||
'issecret' = 'false'
|
||||
}
|
||||
|
||||
# We don't want sessions cached since we will be updating the endpoints quite frequently
|
||||
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data 'False' -Properties @{
|
||||
'variable' = 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED'
|
||||
'issecret' = 'false'
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "No internal endpoints found in NuGet.config"
|
||||
}
|
||||
}
|
||||
|
||||
#Workaround for https://github.com/microsoft/msbuild/issues/4430
|
||||
function InstallDotNetSdkAndRestoreArcade {
|
||||
$dotnetTempDir = "$RepoRoot\dotnet"
|
||||
$dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*)
|
||||
$dotnet = "$dotnetTempDir\dotnet.exe"
|
||||
$restoreProjPath = "$PSScriptRoot\restore.proj"
|
||||
|
||||
Write-Host "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..."
|
||||
InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion"
|
||||
|
||||
'<Project Sdk="Microsoft.DotNet.Arcade.Sdk"/>' | Out-File "$restoreProjPath"
|
||||
|
||||
& $dotnet restore $restoreProjPath
|
||||
|
||||
Write-Host "Arcade SDK restored!"
|
||||
|
||||
if (Test-Path -Path $restoreProjPath) {
|
||||
Remove-Item $restoreProjPath
|
||||
}
|
||||
|
||||
if (Test-Path -Path $dotnetTempDir) {
|
||||
Remove-Item $dotnetTempDir -Recurse
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Push-Location $PSScriptRoot
|
||||
|
||||
if ($Operation -like "setup") {
|
||||
SetupCredProvider $AuthToken
|
||||
}
|
||||
elseif ($Operation -like "install-restore") {
|
||||
InstallDotNetSdkAndRestoreArcade
|
||||
}
|
||||
else {
|
||||
Write-Host "Unknown operation '$Operation'!"
|
||||
ExitWithExitCode 1
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host $_
|
||||
Write-Host $_.Exception
|
||||
Write-Host $_.ScriptStackTrace
|
||||
ExitWithExitCode 1
|
||||
}
|
||||
finally {
|
||||
Pop-Location
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed
|
||||
# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in
|
||||
# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables.
|
||||
# This should ONLY be called from identified internal builds
|
||||
function SetupCredProvider {
|
||||
local authToken=$1
|
||||
|
||||
# Install the Cred Provider NuGet plugin
|
||||
echo "Setting up Cred Provider NuGet plugin in the agent..."...
|
||||
echo "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..."
|
||||
|
||||
local url="https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh"
|
||||
|
||||
echo "Writing the contents of 'installcredprovider.ps1' locally..."
|
||||
local installcredproviderPath="installcredprovider.sh"
|
||||
if command -v curl > /dev/null; then
|
||||
curl $url > "$installcredproviderPath"
|
||||
else
|
||||
wget -q -O "$installcredproviderPath" "$url"
|
||||
fi
|
||||
|
||||
echo "Installing plugin..."
|
||||
. "$installcredproviderPath"
|
||||
|
||||
echo "Deleting local copy of 'installcredprovider.sh'..."
|
||||
rm installcredprovider.sh
|
||||
|
||||
if [ ! -d "$HOME/.nuget/plugins" ]; then
|
||||
echo "CredProvider plugin was not installed correctly!"
|
||||
ExitWithExitCode 1
|
||||
else
|
||||
echo "CredProvider plugin was installed correctly!"
|
||||
fi
|
||||
|
||||
# Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable
|
||||
# feeds successfully
|
||||
|
||||
local nugetConfigPath="$repo_root/NuGet.config"
|
||||
|
||||
if [ ! "$nugetConfigPath" ]; then
|
||||
echo "NuGet.config file not found in repo's root!"
|
||||
ExitWithExitCode 1
|
||||
fi
|
||||
|
||||
local endpoints='['
|
||||
local nugetConfigPackageValues=`cat "$nugetConfigPath" | grep "key=\"darc-int-"`
|
||||
local pattern="value=\"(.*)\""
|
||||
|
||||
for value in $nugetConfigPackageValues
|
||||
do
|
||||
if [[ $value =~ $pattern ]]; then
|
||||
local endpoint="${BASH_REMATCH[1]}"
|
||||
endpoints+="{\"endpoint\": \"$endpoint\", \"password\": \"$authToken\"},"
|
||||
fi
|
||||
done
|
||||
|
||||
endpoints=${endpoints%?}
|
||||
endpoints+=']'
|
||||
|
||||
if [ ${#endpoints} -gt 2 ]; then
|
||||
# Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}'
|
||||
local endpointCredentials="{\"endpointCredentials\": "$endpoints"}"
|
||||
|
||||
echo "##vso[task.setvariable variable=VSS_NUGET_EXTERNAL_FEED_ENDPOINTS]$endpointCredentials"
|
||||
echo "##vso[task.setvariable variable=NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED]False"
|
||||
else
|
||||
echo "No internal endpoints found in NuGet.config"
|
||||
fi
|
||||
}
|
||||
|
||||
# Workaround for https://github.com/microsoft/msbuild/issues/4430
|
||||
function InstallDotNetSdkAndRestoreArcade {
|
||||
local dotnetTempDir="$repo_root/dotnet"
|
||||
local dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*)
|
||||
local restoreProjPath="$repo_root/eng/common/restore.proj"
|
||||
|
||||
echo "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..."
|
||||
echo "<Project Sdk=\"Microsoft.DotNet.Arcade.Sdk\"/>" > "$restoreProjPath"
|
||||
|
||||
InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion"
|
||||
|
||||
local res=`$dotnetTempDir/dotnet restore $restoreProjPath`
|
||||
echo "Arcade SDK restored!"
|
||||
|
||||
# Cleanup
|
||||
if [ "$restoreProjPath" ]; then
|
||||
rm "$restoreProjPath"
|
||||
fi
|
||||
|
||||
if [ "$dotnetTempDir" ]; then
|
||||
rm -r $dotnetTempDir
|
||||
fi
|
||||
}
|
||||
|
||||
source="${BASH_SOURCE[0]}"
|
||||
operation=''
|
||||
authToken=''
|
||||
repoName=''
|
||||
|
||||
while [[ $# > 0 ]]; do
|
||||
opt="$(echo "$1" | awk '{print tolower($0)}')"
|
||||
case "$opt" in
|
||||
--operation)
|
||||
operation=$2
|
||||
shift
|
||||
;;
|
||||
--authtoken)
|
||||
authToken=$2
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Invalid argument: $1"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
while [[ -h "$source" ]]; do
|
||||
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
|
||||
source="$(readlink "$source")"
|
||||
# if $source was a relative symlink, we need to resolve it relative to the path where the
|
||||
# symlink file was located
|
||||
[[ $source != /* ]] && source="$scriptroot/$source"
|
||||
done
|
||||
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
|
||||
|
||||
. "$scriptroot/tools.sh"
|
||||
|
||||
if [ "$operation" = "setup" ]; then
|
||||
SetupCredProvider $authToken
|
||||
elif [ "$operation" = "install-restore" ]; then
|
||||
InstallDotNetSdkAndRestoreArcade
|
||||
else
|
||||
echo "Unknown operation '$operation'!"
|
||||
fi
|
|
@ -57,7 +57,6 @@ jobs:
|
|||
/p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com
|
||||
/p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }}
|
||||
/p:Configuration=$(_BuildConfig)
|
||||
/v:detailed
|
||||
condition: ${{ parameters.condition }}
|
||||
continueOnError: ${{ parameters.continueOnError }}
|
||||
- task: powershell@2
|
||||
|
|
|
@ -138,8 +138,7 @@ stages:
|
|||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com/ --password $(MaestroAccessToken)
|
||||
continueOnError: true
|
||||
darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com/ --password $(MaestroAccessToken) --latest-location
|
||||
|
||||
- template: ../promote-build.yml
|
||||
parameters:
|
||||
|
|
|
@ -84,8 +84,7 @@ stages:
|
|||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com --password $(MaestroAccessToken)
|
||||
continueOnError: true
|
||||
darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com --password $(MaestroAccessToken) --latest-location
|
||||
|
||||
- template: ../promote-build.yml
|
||||
parameters:
|
||||
|
|
|
@ -16,11 +16,23 @@ jobs:
|
|||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
. "$(Build.SourcesDirectory)/eng/common/tools.ps1"
|
||||
|
||||
$BarId = Get-Content "$(Build.StagingDirectory)/ReleaseConfigs/BARBuildId.txt"
|
||||
Write-PipelineSetVariable -Name 'BARBuildId' -Value $BarId
|
||||
|
||||
$Channels = ""
|
||||
Get-Content "$(Build.StagingDirectory)/ReleaseConfigs/Channels.txt" | ForEach-Object { $Channels += "$_ ," }
|
||||
Write-PipelineSetVariable -Name 'InitialChannels' -Value "$Channels"
|
||||
# This is needed to make Write-PipelineSetVariable works in this context
|
||||
if ($env:BUILD_BUILDNUMBER -ne "" -and $env:BUILD_BUILDNUMBER -ne $null) {
|
||||
$ci = $true
|
||||
|
||||
. "$(Build.SourcesDirectory)/eng/common/tools.ps1"
|
||||
|
||||
$BarId = Get-Content "$(Build.StagingDirectory)/ReleaseConfigs/BARBuildId.txt"
|
||||
Write-PipelineSetVariable -Name 'BARBuildId' -Value $BarId
|
||||
|
||||
Write-Host "Asked Write-PipelineSetVariable to create BARBuildId with value '$BarId'"
|
||||
|
||||
$Channels = ""
|
||||
Get-Content "$(Build.StagingDirectory)/ReleaseConfigs/Channels.txt" | ForEach-Object { $Channels += "$_ ," }
|
||||
Write-PipelineSetVariable -Name 'InitialChannels' -Value "$Channels"
|
||||
|
||||
Write-Host "Asked Write-PipelineSetVariable to create InitialChannels with value '$Channels'"
|
||||
}
|
||||
else {
|
||||
Write-Host "This step can only be run in an Azure DevOps CI environment."
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
}
|
||||
},
|
||||
"msbuild-sdks": {
|
||||
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19315.2",
|
||||
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19319.1",
|
||||
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2"
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче