Fix vcpkg cache (#5963)

This commit is contained in:
Wes Haggard 2024-09-06 09:57:58 -07:00 committed by GitHub
parent 3433445498
commit 10025fd2a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -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')) }}:

View File

@ -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"