diff options
| author | Billy O'Neal <bion@microsoft.com> | 2020-06-26 12:37:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-26 12:37:53 -0700 |
| commit | 81ae2ed94bf51fdd453b383135a809dea3d45cce (patch) | |
| tree | 959ac75af38a41fa1a795a1e233d4a70dee80af2 /scripts | |
| parent | 309f6fc9bcb48a68b692b2f4707b5fea7eaf1c60 (diff) | |
| download | vcpkg-81ae2ed94bf51fdd453b383135a809dea3d45cce.tar.gz vcpkg-81ae2ed94bf51fdd453b383135a809dea3d45cce.zip | |
[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
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/azure-pipelines/test-modified-ports.ps1 | 35 |
1 files changed, 18 insertions, 17 deletions
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'
}
|
