rebuild-rest-pipeline.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Rebuild pipeline for WinGet rest source.
  2. # Name of the run
  3. name: '$(Build.DefinitionName)-$(Build.DefinitionVersion)-$(Date:yyyyMMdd)-$(Rev:r)'
  4. trigger: none
  5. pr: none
  6. jobs:
  7. # Agent phase.
  8. - job: 'Rebuild'
  9. displayName: 'Start Rebuild'
  10. pool:
  11. vmImage: 'windows-latest'
  12. variables:
  13. skipComponentGovernanceDetection: ${{ true }}
  14. runCodesignValidationInjection: ${{ false }}
  15. steps:
  16. # Allow scripts to access the system token.
  17. - checkout: none
  18. persistCredentials: true
  19. # Downloads all the setup files and its dependencies.
  20. - task: AzureCLI@1
  21. displayName: 'Azure Setup'
  22. inputs:
  23. azureSubscription: '$(WinGet.Subscription)'
  24. scriptLocation: inlineScript
  25. inlineScript: 'az storage blob download-batch -d . --pattern * -s servicewrapper --output none'
  26. env:
  27. AZURE_STORAGE_CONNECTION_STRING: $(ValidationStorageAccountConnectionString)
  28. # WinGet setup
  29. - script: 'winget_rebuild_setup.cmd'
  30. name: 'wingetsetup'
  31. displayName: 'WinGet Setup'
  32. workingDirectory: scripts
  33. env:
  34. HOST_KEY: $(AzureFunctionHostKey)
  35. RESTSOURCE_REBUILD_ENDPOINT: $(AzFuncRestSourceRebuildEndpoint)
  36. # Agentless phase. Depends on previous job.
  37. - job: 'PublishToRestSource'
  38. pool: server
  39. timeoutInMinutes: 1500
  40. displayName: 'Publish to rest source'
  41. dependsOn:
  42. - 'Rebuild'
  43. variables:
  44. HostKeySecret: $[ dependencies.Rebuild.outputs['wingetsetup.hostkey']]
  45. RestSourceRebuildEndpointSecret: $[ dependencies.Rebuild.outputs['wingetsetup.restsourceRebuildEndpoint']]
  46. steps:
  47. # Rebuild Rest source.
  48. - task: AzureFunction@1
  49. displayName: 'Publish to rest source'
  50. inputs:
  51. function: '$(RestSourceRebuildEndpointSecret)'
  52. key: '$(HostKeySecret)'
  53. body: |
  54. {
  55. "operationId": "$(Build.BuildNumber)",
  56. "BuildId": "$(Build.BuildId)",
  57. "PlanUrl": "$(system.CollectionUri)",
  58. "HubName": "$(system.HostType)",
  59. "pipelineType": "RebuildPipeline",
  60. "ProjectId": "$(system.TeamProjectId)",
  61. "PlanId": "$(system.PlanId)",
  62. "JobId": "$(system.JobId)",
  63. "TimelineId": "$(system.TimelineId)",
  64. "TaskInstanceId": "$(system.TaskInstanceId)",
  65. "AuthToken": "$(system.AccessToken)"
  66. }
  67. waitForCompletion: "true"