From 10025fd2a24060e81a1c9225dc1c38934ce4dd7e Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Fri, 6 Sep 2024 09:57:58 -0700 Subject: [PATCH] Fix vcpkg cache (#5963) --- eng/pipelines/templates/steps/vcpkg.yml | 2 +- eng/scripts/Set-VcpkgWriteModeCache.ps1 | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/templates/steps/vcpkg.yml b/eng/pipelines/templates/steps/vcpkg.yml index 0e7e420b9..01b702882 100644 --- a/eng/pipelines/templates/steps/vcpkg.yml +++ b/eng/pipelines/templates/steps/vcpkg.yml @@ -1,7 +1,7 @@ steps: - pwsh: | Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SOURCES_SECRET;issecret=true;]clear;x-azblob,https://cppvcpkgcache.blob.core.windows.net/public-vcpkg-container,,read" - Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES_SECRET;issecret=true;]clear;x-azurl,https://cppvcpkgcache.blob.core.windows.net/public-vcpkg-asset-container/,,read" + Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES_SECRET;issecret=true;]clear;x-azurl,https://cppvcpkgcache.blob.core.windows.net/public-vcpkg-container,,read" displayName: Set Vcpkg Variables - ${{if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: diff --git a/eng/scripts/Set-VcpkgWriteModeCache.ps1 b/eng/scripts/Set-VcpkgWriteModeCache.ps1 index a319384a0..5435f09a6 100644 --- a/eng/scripts/Set-VcpkgWriteModeCache.ps1 +++ b/eng/scripts/Set-VcpkgWriteModeCache.ps1 @@ -1,8 +1,8 @@ param( - [string] $StorageAccountName = 'cppvcpkgcache' + [string] $StorageAccountName = 'cppvcpkgcache', + [string] $StorageContainerName = 'public-vcpkg-container' ) - ."$PSScriptRoot/../common/scripts/Helpers/PSModule-Helpers.ps1" Write-Host "`$env:PSModulePath = $($env:PSModulePath)" @@ -31,8 +31,8 @@ $ctx = New-AzStorageContext ` -UseConnectedAccount $vcpkgBinarySourceSas = New-AzStorageContainerSASToken ` - -Name $StorageAccountName ` - -Permission "rwc" ` + -Name $StorageContainerName ` + -Permission "rwcl" ` -Context $ctx ` -ExpiryTime (Get-Date).AddHours(1) @@ -40,5 +40,5 @@ Write-Host "Ensure redaction of SAS tokens in logs" Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SAS_TOKEN;issecret=true;]$vcpkgBinarySourceSas" Write-Host "Setting vcpkg binary cache to read and write" -Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SOURCES_SECRET;issecret=true;]clear;x-azblob,https://cppvcpkgcache.blob.core.windows.net/public-vcpkg-container,$vcpkgBinarySourceSas,readwrite" -Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES_SECRET;issecret=true;]clear;x-azurl,https://cppvcpkgcache.blob.core.windows.net/public-vcpkg-asset-container/,?$vcpkgBinarySourceSas,readwrite" +Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SOURCES_SECRET;issecret=true;]clear;x-azblob,https://cppvcpkgcache.blob.core.windows.net/$StorageContainerName,$vcpkgBinarySourceSas,readwrite" +Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES_SECRET;issecret=true;]clear;x-azurl,https://cppvcpkgcache.blob.core.windows.net/$StorageContainerName,$vcpkgBinarySourceSas,readwrite"