Skip to content

Commit 0caa472

Browse files
Set-VcpkgWriteModeCache -- add token timeout param for cmake generate's that exceed 1 hour (this can happen in C++ API View) (#43470)
Co-authored-by: Daniel Jurek <[email protected]>
1 parent bfb61df commit 0caa472

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

eng/common/pipelines/templates/steps/set-vcpkg-cache-vars.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2+
parameters:
3+
- name: TokenTimeoutInHours
4+
type: number
5+
default: 1
6+
17
steps:
28
- pwsh: |
39
Write-Host "Setting vcpkg cache variables for read only access to vcpkg binary and asset caches"
@@ -12,6 +18,7 @@ steps:
1218
azureSubscription: 'Azure SDK Artifacts'
1319
ScriptType: FilePath
1420
ScriptPath: eng/common/scripts/Set-VcpkgWriteModeCache.ps1
21+
ScriptArguments: -TokenTimeoutInHours ${{ parameters.TokenTimeoutInHours }}
1522
azurePowerShellVersion: LatestVersion
1623
pwsh: true
1724
# This step is idempotent and can be run multiple times in cases of

eng/common/scripts/Set-VcpkgWriteModeCache.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/env pwsh
22
param(
33
[string] $StorageAccountName = 'azuresdkartifacts',
4-
[string] $StorageContainerName = 'public-vcpkg-container'
4+
[string] $StorageContainerName = 'public-vcpkg-container',
5+
[int] $TokenTimeoutInHours = 1
56
)
67

78
$ctx = New-AzStorageContext `
@@ -12,7 +13,7 @@ $vcpkgBinarySourceSas = New-AzStorageContainerSASToken `
1213
-Name $StorageContainerName `
1314
-Permission "rwcl" `
1415
-Context $ctx `
15-
-ExpiryTime (Get-Date).AddHours(1)
16+
-ExpiryTime (Get-Date).AddHours($TokenTimeoutInHours)
1617

1718
# Ensure redaction of SAS tokens in logs
1819
Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SAS_TOKEN;issecret=true;]$vcpkgBinarySourceSas"

0 commit comments

Comments
 (0)