From 81ae2ed94bf51fdd453b383135a809dea3d45cce Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Fri, 26 Jun 2020 12:37:53 -0700 Subject: [vcpkg] Add write-only binary caching for CI. (#12130) Changes to the binary caching spec made as comments over at https://github.com/microsoft/vcpkg/pull/11204#pullrequestreview-438518901 --- scripts/azure-pipelines/test-modified-ports.ps1 | 35 +++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/azure-pipelines/test-modified-ports.ps1 b/scripts/azure-pipelines/test-modified-ports.ps1 index e38115b32..c33219795 100755 --- a/scripts/azure-pipelines/test-modified-ports.ps1 +++ b/scripts/azure-pipelines/test-modified-ports.ps1 @@ -28,13 +28,13 @@ supplied, binary caching will be used. [CmdletBinding()] Param( - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string]$Triplet, - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ArchivesRoot, - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $WorkingRoot, [ValidateNotNullOrEmpty()] @@ -53,33 +53,34 @@ $buildtreesRoot = Join-Path $WorkingRoot 'buildtrees' $installRoot = Join-Path $WorkingRoot 'installed' $packagesRoot = Join-Path $WorkingRoot 'packages' $commonArgs = @( + '--binarycaching', "--x-buildtrees-root=$buildtreesRoot", "--x-install-root=$installRoot", "--x-packages-root=$packagesRoot" ) -$binaryCaching = $false +$binaryCachingMode = 'readwrite' if ([string]::IsNullOrWhiteSpace($BuildReason)) { - Write-Host 'Build reason not specified, defaulting to using binary caching.' - $binaryCaching = $true -} elseif ($BuildReason -eq 'PullRequest') { - Write-Host 'Build reason was Pull Request, using binary caching.' - $binaryCaching = $true + Write-Host 'Build reason not specified, defaulting to using binary caching in read write mode.' } - -if ($binaryCaching) { - $commonArgs += @( - '--binarycaching', - "--x-binarysource=clear;files,$ArchivesRoot,upload" - ) +elseif ($BuildReason -eq 'PullRequest') { + Write-Host 'Build reason was Pull Request, using binary caching in read write mode.' +} +else { + Write-Host "Build reason was $BuildReason, using binary caching in write only mode." + $binaryCachingMode = 'write' } +$commonArgs += @("--x-binarysource=clear;files,$ArchivesRoot,$binaryCachingMode") + if ($Triplet -eq 'x64-linux') { $env:HOME = '/home/agent' $executableExtension = [string]::Empty -} elseif ($Triplet -eq 'x64-osx') { +} +elseif ($Triplet -eq 'x64-osx') { $executableExtension = [string]::Empty -} else { +} +else { $executableExtension = '.exe' } -- cgit v1.2.3