-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies from https://github.com/dotnet/arcade build 20190…
…627.39 (#350) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19327.39
- Loading branch information
1 parent
7036226
commit 7f30d8f
Showing
9 changed files
with
145 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This script validates NuGet package metadata information using this | ||
# tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage | ||
|
||
param( | ||
[Parameter(Mandatory=$true)][string] $PackagesPath, # Path to where the packages to be validated are | ||
[Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
Set-StrictMode -Version 2.0 | ||
|
||
. $PSScriptRoot\..\tools.ps1 | ||
|
||
try { | ||
$url = "https://raw.githubusercontent.com/NuGet/NuGetGallery/jver-verify/src/VerifyMicrosoftPackage/verify.ps1" | ||
|
||
New-Item -ItemType "directory" -Path ${ToolDestinationPath} -Force | ||
|
||
Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1 | ||
|
||
& ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg | ||
} | ||
catch { | ||
Write-PipelineTaskError "NuGet package validation failed. Please check error logs." | ||
Write-Host $_ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
param( | ||
[Parameter(Mandatory=$true)][string] $SourceRepo, | ||
[Parameter(Mandatory=$true)][int] $ChannelId, | ||
[string] $MaestroEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com", | ||
[string] $BarToken, | ||
[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 | ||
} | ||
|
||
# Get all the $SourceRepo subscriptions | ||
$normalizedSurceRepo = $SourceRepo.Replace('dnceng@', '') | ||
$getSubscriptionsApiEndpoint = "$maestroEndpoint/api/subscriptions?sourceRepository=$normalizedSurceRepo&api-version=$apiVersion" | ||
$headers = Get-Headers 'application/json' $barToken | ||
|
||
$subscriptions = Invoke-WebRequest -Uri $getSubscriptionsApiEndpoint -Headers $headers | ConvertFrom-Json | ||
|
||
if (!$subscriptions) { | ||
Write-Host "No subscriptions found for source repo '$normalizedSurceRepo' in channel '$ChannelId'" | ||
return | ||
} | ||
|
||
$subscriptionsToTrigger = New-Object System.Collections.Generic.List[string] | ||
$failedTriggeredSubscription = $false | ||
|
||
# Get all enabled subscriptions that need dependency flow on 'everyBuild' | ||
foreach ($subscription in $subscriptions) { | ||
if ($subscription.enabled -and $subscription.policy.updateFrequency -like 'everyBuild' -and $subscription.channel.id -eq $ChannelId) { | ||
Write-Host "$subscription.id" | ||
[void]$subscriptionsToTrigger.Add($subscription.id) | ||
} | ||
} | ||
|
||
foreach ($subscriptionToTrigger in $subscriptionsToTrigger) { | ||
try { | ||
$triggerSubscriptionApiEndpoint = "$maestroEndpoint/api/subscriptions/$subscriptionToTrigger/trigger?api-version=$apiVersion" | ||
$headers = Get-Headers 'application/json' $BarToken | ||
|
||
Write-Host "Triggering subscription '$subscriptionToTrigger'..." | ||
|
||
Invoke-WebRequest -Uri $triggerSubscriptionApiEndpoint -Headers $headers -Method Post | ||
|
||
Write-Host "Subscription '$subscriptionToTrigger' triggered!" | ||
} | ||
catch | ||
{ | ||
Write-Host "There was an error while triggering subscription '$subscriptionToTrigger'" | ||
Write-Host $_ | ||
Write-Host $_.ScriptStackTrace | ||
$failedTriggeredSubscription = $true | ||
} | ||
} | ||
|
||
if ($failedTriggeredSubscription) { | ||
Write-Host "At least one subscription failed to be triggered..." | ||
ExitWithExitCode 1 | ||
} | ||
|
||
Write-Host "All subscriptions were triggered successfully!" |
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,11 @@ | ||
parameters: | ||
ChannelId: 0 | ||
|
||
steps: | ||
- task: PowerShell@2 | ||
displayName: Triggering subscriptions | ||
inputs: | ||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/trigger-subscriptions.ps1 | ||
arguments: -SourceRepo $(Build.Repository.Uri) | ||
-ChannelId ${{ parameters.ChannelId }} | ||
-BarToken $(MaestroAccessTokenInt) |
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