| 1 |
param( |
| 2 |
[Parameter(Mandatory=$true)][int] $BarBuildId, # ID of the build which assets should be downloaded |
| 3 |
[Parameter(Mandatory=$true)][string] $DropLocation, # Where the assets should be downloaded to |
| 4 |
[Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, # Token used to access Maestro API |
| 5 |
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', # Maestro API URL |
| 6 |
[Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16' # Version of Maestro API to use |
| 7 |
) |
| 8 |
|
| 9 |
try { |
| 10 |
. $PSScriptRoot\post-build-utils.ps1 |
| 11 |
|
| 12 |
Write-Host 'Installing DARC ...' |
| 13 |
|
| 14 |
. $PSScriptRoot\..\darc-init.ps1 |
| 15 |
$exitCode = $LASTEXITCODE |
| 16 |
|
| 17 |
if ($exitCode -ne 0) { |
| 18 |
Write-PipelineTelemetryError -Category "Darc" -Message "Something failed while running 'darc-init.ps1'. Check for errors above. Exiting now..." |
| 19 |
ExitWithExitCode $exitCode |
| 20 |
} |
| 21 |
|
| 22 |
# For now, only use a dry run. |
| 23 |
# Ideally we would change darc to enable a quick request that |
| 24 |
# would check whether the file exists that you can download it, |
| 25 |
# and that it won't conflict with other files. |
| 26 |
# https://github.com/dotnet/arcade/issues/3674 |
| 27 |
# Right now we can't remove continue-on-error because we ocassionally will have |
| 28 |
# dependencies that have no associated builds (e.g. an old dependency). |
| 29 |
# We need to add an option to baseline specific dependencies away, or add them manually |
| 30 |
# to the BAR. |
| 31 |
darc gather-drop --non-shipping ` |
| 32 |
--dry-run ` |
| 33 |
--continue-on-error ` |
| 34 |
--id $BarBuildId ` |
| 35 |
--output-dir $DropLocation ` |
| 36 |
--bar-uri $MaestroApiEndpoint ` |
| 37 |
--password $MaestroApiAccessToken ` |
| 38 |
--latest-location |
| 39 |
} |
| 40 |
catch { |
| 41 |
Write-Host $_.ScriptStackTrace |
| 42 |
Write-PipelineTelemetryError -Category "Darc" -Message $_ |
| 43 |
ExitWithExitCode 1 |
| 44 |
} |