This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25455 from dotnet/darc-release/3.0-7b624a21-2f92-…
…409c-9902-75d5b2b62c49 [release/3.0] Update dependencies from dotnet/arcade
- Loading branch information
Showing
20 changed files
with
593 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
param( | ||
[Parameter(Mandatory=$true)][int] $BuildId, | ||
[Parameter(Mandatory=$true)][int] $ChannelId, | ||
[Parameter(Mandatory=$true)][string] $BarToken, | ||
[string] $MaestroEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com", | ||
[string] $ApiVersion = "2019-01-16" | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
Set-StrictMode -Version 2.0 | ||
|
||
. $PSScriptRoot\..\tools.ps1 | ||
|
||
function Get-Headers([string]$accept, [string]$barToken) { | ||
$headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' | ||
$headers.Add('Accept',$accept) | ||
$headers.Add('Authorization',"Bearer $barToken") | ||
return $headers | ||
} | ||
|
||
try { | ||
$maestroHeaders = Get-Headers 'application/json' $BarToken | ||
|
||
# Get info about which channels the build has already been promoted to | ||
$getBuildApiEndpoint = "$MaestroEndpoint/api/builds/${BuildId}?api-version=$ApiVersion" | ||
$buildInfo = Invoke-WebRequest -Method Get -Uri $getBuildApiEndpoint -Headers $maestroHeaders | ConvertFrom-Json | ||
|
||
if (!$buildInfo) { | ||
Write-Host "Build with BAR ID $BuildId was not found in BAR!" | ||
ExitWithExitCode 1 | ||
} | ||
|
||
# Find whether the build is already assigned to the channel or not | ||
if ($buildInfo.channels) { | ||
foreach ($channel in $buildInfo.channels) { | ||
if ($channel.Id -eq $ChannelId) { | ||
Write-Host "The build with BAR ID $BuildId is already on channel $ChannelId!" | ||
ExitWithExitCode 0 | ||
} | ||
} | ||
} | ||
|
||
Write-Host "Build not present in channel $ChannelId. Promoting build ... " | ||
|
||
$promoteBuildApiEndpoint = "$maestroEndpoint/api/channels/${ChannelId}/builds/${BuildId}?api-version=$ApiVersion" | ||
Invoke-WebRequest -Method Post -Uri $promoteBuildApiEndpoint -Headers $maestroHeaders | ||
Write-Host "done." | ||
} | ||
catch { | ||
Write-Host "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'" | ||
Write-Host $_ | ||
Write-Host $_.ScriptStackTrace | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
param( | ||
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where artifact packages are stored | ||
[Parameter(Mandatory=$true)][string] $ExtractPath # Full path to directory where the packages will be extracted | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
Set-StrictMode -Version 2.0 | ||
$ExtractPackage = { | ||
param( | ||
[string] $PackagePath # Full path to a NuGet package | ||
) | ||
|
||
if (!(Test-Path $PackagePath)) { | ||
Write-PipelineTaskError "Input file does not exist: $PackagePath" | ||
ExitWithExitCode 1 | ||
} | ||
|
||
$RelevantExtensions = @(".dll", ".exe", ".pdb") | ||
Write-Host -NoNewLine "Extracting" ([System.IO.Path]::GetFileName($PackagePath)) "... " | ||
|
||
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) | ||
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId | ||
|
||
Add-Type -AssemblyName System.IO.Compression.FileSystem | ||
|
||
[System.IO.Directory]::CreateDirectory($ExtractPath); | ||
|
||
try { | ||
$zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) | ||
|
||
$zip.Entries | | ||
Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | | ||
ForEach-Object { | ||
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.Name | ||
|
||
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true) | ||
} | ||
} | ||
catch { | ||
|
||
} | ||
finally { | ||
$zip.Dispose() | ||
} | ||
} | ||
function ExtractArtifacts { | ||
$Jobs = @() | ||
Get-ChildItem "$InputPath\*.nupkg" | | ||
ForEach-Object { | ||
$Jobs += Start-Job -ScriptBlock $ExtractPackage -ArgumentList $_.FullName | ||
} | ||
|
||
foreach ($Job in $Jobs) { | ||
Wait-Job -Id $Job.Id | Receive-Job | ||
} | ||
} | ||
|
||
try { | ||
Measure-Command { ExtractArtifacts } | ||
} | ||
catch { | ||
Write-Host $_ | ||
Write-Host $_.Exception | ||
Write-Host $_.ScriptStackTrace | ||
ExitWithExitCode 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 167 additions & 0 deletions
167
eng/common/templates/post-build/channels/internal-servicing.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
parameters: | ||
enableSymbolValidation: true | ||
|
||
stages: | ||
- stage: IS_Publish | ||
dependsOn: validate | ||
variables: | ||
- template: ../common-variables.yml | ||
displayName: Internal Servicing | ||
jobs: | ||
- template: ../setup-maestro-vars.yml | ||
|
||
- job: | ||
displayName: Symbol Publishing | ||
dependsOn: setupMaestroVars | ||
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) | ||
variables: | ||
- group: DotNet-Symbol-Server-Pats | ||
pool: | ||
vmImage: 'windows-2019' | ||
steps: | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download Artifacts | ||
inputs: | ||
downloadType: specific files | ||
matchingPattern: "*Artifacts*" | ||
|
||
- task: PowerShell@2 | ||
displayName: Publish | ||
inputs: | ||
filePath: eng\common\sdk-task.ps1 | ||
arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet | ||
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) | ||
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) | ||
/p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' | ||
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' | ||
/p:Configuration=Release | ||
|
||
- job: | ||
displayName: Publish Assets | ||
dependsOn: setupMaestroVars | ||
variables: | ||
- group: DotNet-Blob-Feed | ||
- group: Publish-Build-Assets | ||
- group: AzureDevOps-Artifact-Feeds-Pats | ||
- name: BARBuildId | ||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] | ||
- name: IsStableBuild | ||
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] | ||
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) | ||
pool: | ||
vmImage: 'windows-2019' | ||
steps: | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download Package Artifacts | ||
inputs: | ||
buildType: current | ||
artifactName: PackageArtifacts | ||
|
||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download Blob Artifacts | ||
inputs: | ||
buildType: current | ||
artifactName: BlobArtifacts | ||
|
||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download Asset Manifests | ||
inputs: | ||
buildType: current | ||
artifactName: AssetManifests | ||
|
||
- task: PowerShell@2 | ||
displayName: Add Assets Location | ||
env: | ||
AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) | ||
inputs: | ||
filePath: eng\common\sdk-task.ps1 | ||
arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet | ||
/p:ChannelId=$(InternalServicing_30_Channel_Id) | ||
/p:IsStableBuild=$(IsStableBuild) | ||
/p:IsInternalBuild=$(IsInternalBuild) | ||
/p:RepositoryName=$(Build.Repository.Name) | ||
/p:CommitSha=$(Build.SourceVersion) | ||
/p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe | ||
/p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' | ||
/p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' | ||
/p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' | ||
/p:BARBuildId=$(BARBuildId) | ||
/p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' | ||
/p:BuildAssetRegistryToken='$(MaestroAccessToken)' | ||
/p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' | ||
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' | ||
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' | ||
/p:Configuration=Release | ||
|
||
- task: NuGetCommand@2 | ||
displayName: Publish Packages to AzDO Feed | ||
condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') | ||
inputs: | ||
command: push | ||
vstsFeed: $(AzDoFeedName) | ||
packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg | ||
publishVstsFeed: $(AzDoFeedName) | ||
|
||
- task: PowerShell@2 | ||
displayName: Publish Blobs to AzDO Feed | ||
inputs: | ||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 | ||
arguments: -FeedName $(AzDoFeedName) | ||
-SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ | ||
-PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) | ||
enabled: false | ||
|
||
|
||
- stage: IS_PublishValidation | ||
displayName: Publish Validation | ||
variables: | ||
- template: ../common-variables.yml | ||
jobs: | ||
- template: ../setup-maestro-vars.yml | ||
|
||
- ${{ if eq(parameters.enableSymbolValidation, 'true') }}: | ||
- job: | ||
displayName: Symbol Availability | ||
dependsOn: setupMaestroVars | ||
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) | ||
pool: | ||
vmImage: 'windows-2019' | ||
steps: | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download Package Artifacts | ||
inputs: | ||
buildType: current | ||
artifactName: PackageArtifacts | ||
|
||
- task: PowerShell@2 | ||
displayName: Check Symbol Availability | ||
inputs: | ||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 | ||
arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) | ||
|
||
- job: | ||
displayName: Gather Drop | ||
dependsOn: setupMaestroVars | ||
variables: | ||
BARBuildId: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] | ||
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) | ||
pool: | ||
vmImage: 'windows-2019' | ||
steps: | ||
- task: PowerShell@2 | ||
displayName: Setup Darc CLI | ||
inputs: | ||
targetType: filePath | ||
filePath: '$(Build.SourcesDirectory)/eng/common/darc-init.ps1' | ||
|
||
- task: PowerShell@2 | ||
displayName: Run Darc gather-drop | ||
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) --latest-location | ||
enabled: false | ||
|
||
- template: ../promote-build.yml | ||
parameters: | ||
ChannelId: ${{ variables.InternalServicing_30_Channel_Id }} |
Oops, something went wrong.