Skip to content

Commit

Permalink
Update OneLocBuildToken (#141)
Browse files Browse the repository at this point in the history
* Update OneLocBuildToken
* Force loc task pool image to windows
  • Loading branch information
MSylvia authored May 25, 2024
1 parent 4fef46a commit c2ae332
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,10 @@ extends:
jobs:
- job: OneLocBuild
displayName: OneLocBuild
pool: $(MicroBuildPoolName)
pool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals 1ESPT-Windows2022
timeoutInMinutes: 30
variables:
- group: Xamarin-Secrets
Expand All @@ -360,6 +363,22 @@ extends:
- checkout: self
clean: true

# https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-security-configuration/configuration-guides/pat-burndown-guidance#authentication-from-pipelines
# Requires Azure client 2.x
- task: AzureCLI@2
displayName: 'Set AzDO.OneLocBuildToken'
enabled: true
inputs:
azureSubscription: 'VSEng-AzureDevOps-ceapex-OneLocBuild' # Azure DevOps service connection
scriptType: 'pscore'
scriptLocation: 'inlineScript'
inlineScript: |
# if this fails, check out this bash script that includes diagnostics:
# https://gist.github.com/johnterickson/19f80a3e969e39f1000d118739176e62
# Note that the resource is specified to limit the token to Azure DevOps
$token = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
Write-Host "##vso[task.setvariable variable=AzDO.OneLocBuildToken;issecret=true]${token}"
- task: OneLocBuild@2
displayName: OneLocBuild
env:
Expand All @@ -368,7 +387,7 @@ extends:
locProj: Localize/LocProject.json
outDir: $(Build.StagingDirectory)
packageSourceAuth: patAuth
patVariable: $(OneLocBuild--PAT)
patVariable: $(AzDO.OneLocBuildToken)
isCreatePrSelected: true
repoType: gitHub
gitHubPatVariable: $(github--pat--vs-mobiletools-engineering-service2)
Expand Down

0 comments on commit c2ae332

Please sign in to comment.