Set-VcpkgWriteModeCache -- add token timeout param for cmake generate's that exceed 1 hour (this can happen in C++ API View) (#6796)
Co-authored-by: Daniel Jurek <djurek@microsoft.com>
This commit is contained in:
parent
9023c03ee8
commit
f0b5bfd684
@ -1,3 +1,9 @@
|
||||
|
||||
parameters:
|
||||
- name: TokenTimeoutInHours
|
||||
type: number
|
||||
default: 1
|
||||
|
||||
steps:
|
||||
- pwsh: |
|
||||
Write-Host "Setting vcpkg cache variables for read only access to vcpkg binary and asset caches"
|
||||
@ -12,6 +18,7 @@ steps:
|
||||
azureSubscription: 'Azure SDK Artifacts'
|
||||
ScriptType: FilePath
|
||||
ScriptPath: eng/common/scripts/Set-VcpkgWriteModeCache.ps1
|
||||
ScriptArguments: -TokenTimeoutInHours ${{ parameters.TokenTimeoutInHours }}
|
||||
azurePowerShellVersion: LatestVersion
|
||||
pwsh: true
|
||||
# This step is idempotent and can be run multiple times in cases of
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
#!/bin/env pwsh
|
||||
param(
|
||||
[string] $StorageAccountName = 'azuresdkartifacts',
|
||||
[string] $StorageContainerName = 'public-vcpkg-container'
|
||||
[string] $StorageContainerName = 'public-vcpkg-container',
|
||||
[int] $TokenTimeoutInHours = 1
|
||||
)
|
||||
|
||||
$ctx = New-AzStorageContext `
|
||||
@ -12,7 +13,7 @@ $vcpkgBinarySourceSas = New-AzStorageContainerSASToken `
|
||||
-Name $StorageContainerName `
|
||||
-Permission "rwcl" `
|
||||
-Context $ctx `
|
||||
-ExpiryTime (Get-Date).AddHours(1)
|
||||
-ExpiryTime (Get-Date).AddHours($TokenTimeoutInHours)
|
||||
|
||||
# Ensure redaction of SAS tokens in logs
|
||||
Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SAS_TOKEN;issecret=true;]$vcpkgBinarySourceSas"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user