Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
Rest rebuild pipeline migration to 1 es pipeline. (microsoft#129182)
Browse files Browse the repository at this point in the history
* This PR migrates the WinGetSVC Rebuild Rest pipeline to 1ES, including changes to the following files:

- rebuild-rest-pipeline.yaml

The winget-pkgs repo was updated with the changes from the winget-pkgs-preprod repo, which had been merged from the pipeline staging process through PR. This manual copying was necessary because the automatic deployment failed for the production pipeline.

[How Validated:]

- The changes have been validated against the preprod environment by manually triggering the pipeline and ensuring successful runs.

WinGetSvc-Publish-ppe

* Improve consistency of pipeline stage names
This commit updates the pipeline stage names to be more consistent across all pipelines. This change improves the readability of the pipeline code.
  • Loading branch information
Madhusudhan-MSFT authored Dec 6, 2023
1 parent 2a84289 commit eab30aa
Showing 1 changed file with 80 additions and 63 deletions.
143 changes: 80 additions & 63 deletions DevOpsPipelineDefinitions/rebuild-rest-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,72 +6,89 @@ name: '$(Build.DefinitionName)-$(Build.DefinitionVersion)-$(Date:yyyyMMdd)-$(Rev
trigger: none
pr: none

jobs:
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2022
os: windows
customBuildTags:
- ES365AIMigrationTooling

# Agent phase.
- job: 'Rebuild'
displayName: 'Start Rebuild'
pool:
vmImage: 'windows-latest'
variables:
skipComponentGovernanceDetection: ${{ true }}
runCodesignValidationInjection: ${{ false }}
timeoutInMinutes: 0
steps:
stages:
- stage: WinGetSvc_Rest_Rebuild
jobs:
# Agent phase.
- job: 'Rebuild'
displayName: 'Start Rebuild'
variables:
skipComponentGovernanceDetection: ${{ true }}
runCodesignValidationInjection: ${{ false }}
timeoutInMinutes: 0
steps:

# Allow scripts to access the system token.
- checkout: none
persistCredentials: true
# Allow scripts to access the system token.
- checkout: none
persistCredentials: true

# Downloads all the setup files and its dependencies.
- task: AzureCLI@1
displayName: 'Azure Setup'
inputs:
azureSubscription: '$(WinGet.Subscription)'
scriptLocation: inlineScript
inlineScript: 'az storage blob download-batch -d . --pattern * -s servicewrapper --output none'
env:
AZURE_STORAGE_CONNECTION_STRING: $(ValidationStorageAccountConnectionString)
# Downloads all the setup files and its dependencies.
- task: AzureCLI@1
displayName: 'Azure Setup'
inputs:
azureSubscription: '$(WinGet.Subscription)'
scriptLocation: inlineScript
inlineScript: 'az storage blob download-batch -d . --pattern * -s servicewrapper --output none'
env:
AZURE_STORAGE_CONNECTION_STRING: $(ValidationStorageAccountConnectionString)

# WinGet setup
- script: 'winget_rebuild_setup.cmd'
name: 'wingetsetup'
displayName: 'WinGet Setup'
workingDirectory: scripts
env:
HOST_KEY: $(AzureFunctionHostKey)
RESTSOURCE_REBUILD_ENDPOINT: $(AzFuncRestSourceRebuildEndpoint)
# WinGet setup
- task: CmdLine@2
name: 'wingetsetup'
displayName: 'WinGet Setup'
env:
HOST_KEY: $(AzureFunctionHostKey)
RESTSOURCE_REBUILD_ENDPOINT: $(AzFuncRestSourceRebuildEndpoint)
inputs:
script: 'winget_rebuild_setup.cmd'
workingDirectory: scripts

# Agentless phase. Depends on previous job.
- job: 'PublishToRestSource'
pool: server
timeoutInMinutes: 1500
displayName: 'Publish to rest source'
dependsOn:
- 'Rebuild'
variables:
HostKeySecret: $[ dependencies.Rebuild.outputs['wingetsetup.hostkey']]
RestSourceRebuildEndpointSecret: $[ dependencies.Rebuild.outputs['wingetsetup.restsourceRebuildEndpoint']]
steps:
# Agentless phase. Depends on previous job.
- job: 'PublishToRestSource'
pool: server
timeoutInMinutes: 1500
displayName: 'Publish to rest source'
dependsOn:
- 'Rebuild'
variables:
HostKeySecret: $[ dependencies.Rebuild.outputs['wingetsetup.hostkey']]
RestSourceRebuildEndpointSecret: $[ dependencies.Rebuild.outputs['wingetsetup.restsourceRebuildEndpoint']]
steps:

# Rebuild Rest source.
- task: AzureFunction@1
displayName: 'Publish to rest source'
inputs:
function: '$(RestSourceRebuildEndpointSecret)'
key: '$(HostKeySecret)'
body: |
{
"operationId": "$(Build.BuildNumber)",
"BuildId": "$(Build.BuildId)",
"PlanUrl": "$(system.CollectionUri)",
"HubName": "$(system.HostType)",
"pipelineType": "RebuildPipeline",
"ProjectId": "$(system.TeamProjectId)",
"PlanId": "$(system.PlanId)",
"JobId": "$(system.JobId)",
"TimelineId": "$(system.TimelineId)",
"TaskInstanceId": "$(system.TaskInstanceId)",
"AuthToken": "$(system.AccessToken)"
}
waitForCompletion: "true"
# Rebuild Rest source.
- task: AzureFunction@1
displayName: 'Publish to rest source'
inputs:
function: '$(RestSourceRebuildEndpointSecret)'
key: '$(HostKeySecret)'
body: |
{
"operationId": "$(Build.BuildNumber)",
"BuildId": "$(Build.BuildId)",
"PlanUrl": "$(system.CollectionUri)",
"HubName": "$(system.HostType)",
"pipelineType": "RebuildPipeline",
"ProjectId": "$(system.TeamProjectId)",
"PlanId": "$(system.PlanId)",
"JobId": "$(system.JobId)",
"TimelineId": "$(system.TimelineId)",
"TaskInstanceId": "$(system.TaskInstanceId)",
"AuthToken": "$(system.AccessToken)"
}
waitForCompletion: "true"

0 comments on commit eab30aa

Please sign in to comment.