Skip to content

Commit

Permalink
Update pipelines (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
msftrubengu authored Apr 30, 2020
1 parent 2b995e0 commit e47406f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 61 deletions.
33 changes: 17 additions & 16 deletions DevOpsPipelineDefinitions/publish-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Publish pipeline for Windows Package Manager.
# Publish pipeline for WinGet.

# Name of the run
name: '$(Build.DefinitionName)-$(Build.DefinitionVersion)-$(Date:yyyyMMdd)-$(Rev:r)'
Expand Down Expand Up @@ -29,31 +29,30 @@ jobs:
- task: AzureCLI@1
displayName: 'Azure Setup'
inputs:
azureSubscription: '$(PackageManagerSubscription)'
azureSubscription: '$(WinGet.Subscription)'
scriptLocation: inlineScript
inlineScript: 'az storage blob download-batch -d . --pattern * -s servicewrapper --output none'
env:
AZURE_STORAGE_CONNECTION_STRING: $(ValidationStorageAccountConnectionString)

# PackageManager setup
- script: 'pkgmgr_publish_setup.cmd'
name: 'pkgmgrsetup'
displayName: 'PackageManager Setup'
# WinGet setup
- script: 'winget_publish_setup.cmd'
name: 'wingetsetup'
displayName: 'WinGet Setup'
workingDirectory: scripts
env:
HOST_KEY: $(AzureFunctionHostKey)
SIGN_ENDPOINT: $(PackageManagerSignEndpoint)
SIGN_ENDPOINT: $(AzFuncSignEndpoint)

- task: CmdLine@2
displayName: 'Validate Commits'
inputs:
script: 'PackageManagerServiceWrapper.exe validate-commits --operationId %BUILD_BUILDNUMBER%'
script: 'WinGetSvcWrapper.exe validate-commits --operationId %BUILD_BUILDNUMBER%'
failOnStderr: true
condition: succeeded()
env:
AzureWebJobsStorage: $(ValidationStorageAccountConnectionString)
CacheConnectionString: $(ActiveCacheConnectionString)
PackageManagerEnvironment: $(PackageManagerEnvironment)
CacheConnectionString: $(CacheStorageAccountConnectionString)
PackagePublisher: $(PackagePublisher)
DIApplicationInsightKey: $(DIApplicationInsightKey)

Expand All @@ -65,11 +64,11 @@ jobs:
dependsOn:
- 'CommitProcessing'
variables:
HostKeySecret: $[ dependencies.CommitProcessing.outputs['pkgmgrsetup.hostkey']]
SignEndpointSecret: $[ dependencies.CommitProcessing.outputs['pkgmgrsetup.signEndpoint']]
HostKeySecret: $[ dependencies.CommitProcessing.outputs['wingetsetup.hostkey']]
SignEndpointSecret: $[ dependencies.CommitProcessing.outputs['wingetsetup.signEndpoint']]
steps:

# Sign Package Manager package.
# Sign package.
- task: AzureFunction@1
displayName: 'Signing package'
inputs:
Expand All @@ -78,6 +77,8 @@ jobs:
body: |
{
"operationId": "$(Build.BuildNumber)",
"PlanUrl": "$(system.CollectionUri)",
"HubName": "$(system.HostType)",
"pipelineType": "CommitPipeline",
"ProjectId": "$(system.TeamProjectId)",
"PlanId": "$(system.PlanId)",
Expand All @@ -104,7 +105,7 @@ jobs:
- task: AzureCLI@1
displayName: 'Azure Setup'
inputs:
azureSubscription: '$(PackageManagerSubscription)'
azureSubscription: '$(WinGet.Subscription)'
scriptLocation: inlineScript
inlineScript: 'az storage blob download-batch -d . --pattern * -s servicewrapper --output none'
env:
Expand All @@ -114,10 +115,10 @@ jobs:
- task: CmdLine@2
displayName: 'Publish'
inputs:
script: 'PackageManagerServiceWrapper.exe publish --operationId %BUILD_BUILDNUMBER%'
script: 'WinGetSvcWrapper.exe publish --operationId %BUILD_BUILDNUMBER%'
failOnStderr: true
condition: succeeded()
env:
AzureWebJobsStorage: $(ValidationStorageAccountConnectionString)
CacheConnectionString: $(ActiveCacheConnectionString)
CacheConnectionString: $(CacheStorageAccountConnectionString)
DIApplicationInsightKey: $(DIApplicationInsightKey)
45 changes: 19 additions & 26 deletions DevOpsPipelineDefinitions/rebuild-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Rebuild pipeline for Windows Package Manager.
# Rebuild pipeline for WinGet.

# Name of the run
name: '$(Build.DefinitionName)-$(Build.DefinitionVersion)-$(Date:yyyyMMdd)-$(Rev:r)'
Expand Down Expand Up @@ -27,30 +27,29 @@ jobs:
- task: AzureCLI@1
displayName: 'Azure Setup'
inputs:
azureSubscription: '$(PackageManagerSubscription)'
azureSubscription: '$(WinGet.Subscription)'
scriptLocation: inlineScript
inlineScript: 'az storage blob download-batch -d . --pattern * -s servicewrapper --output none'
env:
AZURE_STORAGE_CONNECTION_STRING: $(ValidationStorageAccountConnectionString)

# PackageManager setup
- script: 'pkgmgr_publish_setup.cmd'
name: 'pkgmgrsetup'
displayName: 'PackageManager Setup'
# WinGet setup
- script: 'winget_publish_setup.cmd'
name: 'wingetsetup'
displayName: 'WinGet Setup'
workingDirectory: scripts
env:
HOST_KEY: $(AzureFunctionHostKey)
SIGN_ENDPOINT: $(PackageManagerSignEndpoint)
SIGN_ENDPOINT: $(AzFuncSignEndpoint)

- task: CmdLine@2
displayName: 'Validate Manifests'
inputs:
script: 'PackageManagerServiceWrapper.exe rebuild --operationId %BUILD_BUILDNUMBER%'
script: 'WinGetSvcWrapper.exe rebuild --operationId %BUILD_BUILDNUMBER%'
failOnStderr: true
condition: succeeded()
env:
AzureWebJobsStorage: $(ValidationStorageAccountConnectionString)
PackageManagerEnvironment: $(PackageManagerEnvironment)
PackagePublisher: $(PackagePublisher)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
DIApplicationInsightKey: $(DIApplicationInsightKey)
Expand All @@ -63,11 +62,11 @@ jobs:
dependsOn:
- 'Rebuild'
variables:
HostKeySecret: $[ dependencies.Rebuild.outputs['pkgmgrsetup.hostkey']]
SignEndpointSecret: $[ dependencies.Rebuild.outputs['pkgmgrsetup.signEndpoint']]
HostKeySecret: $[ dependencies.Rebuild.outputs['wingetsetup.hostkey']]
SignEndpointSecret: $[ dependencies.Rebuild.outputs['wingetsetup.signEndpoint']]
steps:

# Sign Package Manager package.
# Sign package.
- task: AzureFunction@1
displayName: 'Signing package'
inputs:
Expand All @@ -76,6 +75,8 @@ jobs:
body: |
{
"operationId": "$(Build.BuildNumber)",
"PlanUrl": "$(system.CollectionUri)",
"HubName": "$(system.HostType)",
"pipelineType": "RebuildPipeline",
"ProjectId": "$(system.TeamProjectId)",
"PlanId": "$(system.PlanId)",
Expand All @@ -102,7 +103,7 @@ jobs:
- task: AzureCLI@1
displayName: 'Azure Setup'
inputs:
azureSubscription: '$(PackageManagerSubscription)'
azureSubscription: '$(WinGet.Subscription)'
scriptLocation: inlineScript
inlineScript: 'az storage blob download-batch -d . --pattern * -s servicewrapper --output none'
env:
Expand All @@ -112,20 +113,12 @@ jobs:
- task: CmdLine@2
displayName: 'Publish'
inputs:
script: 'PackageManagerServiceWrapper.exe rebuild-publish --operationId %BUILD_BUILDNUMBER%'
script: 'WinGetSvcWrapper.exe rebuild-publish --operationId %BUILD_BUILDNUMBER%'
failOnStderr: true
condition: succeeded()
env:
AzureWebJobsStorage: $(ValidationStorageAccountConnectionString)
AzureServicesAuthConnectionString: $(AzureServicesAuthConnectionString)
CacheConnectionString: $(BackupCacheConnectionString)
CacheAStorageAccountConnectionString: $(CacheAStorageAccountConnectionString)
CacheAStorageAccountName: $(CacheAStorageAccountName)
CacheBStorageAccountConnectionString: $(CacheBStorageAccountConnectionString)
CacheBStorageAccountName: $(CacheBStorageAccountName)
PackageManagerSubscriptionId: $(PackageManagerSubscriptionId)
PackageManagerCdnProfile: $(PackageManagerCdnProfile)
PackageManagerConnectionStringKv: $(PackageManagerConnectionStringKv)
CacheConnectionString: $(CacheStorageAccountConnectionString)
DIApplicationInsightKey: $(DIApplicationInsightKey)

# Agent phase. Depends on previous job.
Expand All @@ -149,16 +142,16 @@ jobs:
- task: AzureCLI@1
displayName: 'Azure Setup'
inputs:
azureSubscription: '$(PackageManagerSubscription)'
azureSubscription: '$(WinGet.Subscription)'
scriptLocation: inlineScript
inlineScript: 'az storage blob download-batch -d . --pattern * -s servicewrapper --output none'
env:
AZURE_STORAGE_CONNECTION_STRING: $(ValidationStorageAccountConnectionString)

- task: CmdLine@2
displayName: 'Package Manager Cleanup'
displayName: 'WinGet Cleanup'
inputs:
script: 'PackageManagerServiceWrapper.exe rebuild-cleanup --operationId %BUILD_BUILDNUMBER%'
script: 'WinGetSvcWrapper.exe rebuild-cleanup --operationId %BUILD_BUILDNUMBER%'
failOnStderr: true
condition: succeeded()
env:
Expand Down
41 changes: 22 additions & 19 deletions DevOpsPipelineDefinitions/validation-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,38 @@ jobs:
displayName: 'Pull Request Validation'
pool:
vmImage: 'windows-latest'
variables:
skipComponentGovernanceDetection: ${{ true }}
runCodesignValidationInjection: ${{ false }}
steps:

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

# PackageManager setup
- script: 'pkgmgr_validation_setup.cmd'
name: 'pkgmgrsetup'
displayName: 'PackageManager Setup'
# WinGet setup
- script: 'winget_validation_setup.cmd'
name: 'wingetsetup'
displayName: 'WinGet Setup'
workingDirectory: scripts
env:
HOST_KEY: $(AzureFunctionHostKey)
SMART_SCREEN_ENDPOINT: $(PackageManagerSmartScreenEndpoint)
SCAN_ENDPOINT: $(PackageManagerScanEndpoint)
LABEL_ENDPOINT: $(PackageManagerSetLabelOnPullRequestEndpoint)
CLEANUP_ENDPOINT: $(PackageManagerCleanupEndpoint)
SMART_SCREEN_ENDPOINT: $(AzFuncSmartScreenEndpoint)
SCAN_ENDPOINT: $(AzFuncScanEndpoint)
LABEL_ENDPOINT: $(AzFuncSetLabelOnPullRequestEndpoint)
CLEANUP_ENDPOINT: $(AzFuncCleanupEndpoint)

# Validates integrity of pull request.
- task: CmdLine@2
displayName: 'Validate Pull Request'
inputs:
script: 'PackageManagerServiceWrapper.exe process-pr --operationId %BUILD_BUILDNUMBER%'
script: 'WinGetSvcWrapper.exe process-pr --operationId %BUILD_BUILDNUMBER%'
failOnStderr: true
condition: succeeded()
env:
Expand All @@ -52,7 +55,7 @@ jobs:
- task: CmdLine@2
displayName: 'Validate Manifest'
inputs:
script: 'PackageManagerServiceWrapper.exe validate-manifests --operationId %BUILD_BUILDNUMBER%'
script: 'WinGetSvcWrapper.exe validate-manifests --operationId %BUILD_BUILDNUMBER%'
failOnStderr: true
condition: succeeded()
env:
Expand All @@ -67,9 +70,9 @@ jobs:
dependsOn:
- 'FileValidation'
variables:
HostKeySecret: $[ dependencies.FileValidation.outputs['pkgmgrsetup.hostkey']]
SmartScreenEndpointSecret: $[ dependencies.FileValidation.outputs['pkgmgrsetup.smartScreenEndpoint']]
ScanEndpointSecret: $[ dependencies.FileValidation.outputs['pkgmgrsetup.scanEndpoint']]
HostKeySecret: $[ dependencies.FileValidation.outputs['wingetsetup.hostkey']]
SmartScreenEndpointSecret: $[ dependencies.FileValidation.outputs['wingetsetup.smartScreenEndpoint']]
ScanEndpointSecret: $[ dependencies.FileValidation.outputs['wingetsetup.scanEndpoint']]
steps:

# Scans all the urls from manifest contents.
Expand Down Expand Up @@ -121,16 +124,16 @@ jobs:
- 'ContentValidation'
condition: succeededOrFailed()
variables:
HostKeySecret: $[ dependencies.FileValidation.outputs['pkgmgrsetup.hostkey']]
LabelEndpointSecret: $[ dependencies.FileValidation.outputs['pkgmgrsetup.labelEndpoint']]
RepositoryId: $[ dependencies.FileValidation.outputs['pkgmgrsetup.repoId']]
CleanupEndpointSecret: $[ dependencies.filevalidation.outputs['pkgmgrsetup.cleanupEndpoint']]
HostKeySecret: $[ dependencies.FileValidation.outputs['wingetsetup.hostkey']]
LabelEndpointSecret: $[ dependencies.FileValidation.outputs['wingetsetup.labelEndpoint']]
RepositoryId: $[ dependencies.FileValidation.outputs['wingetsetup.repoId']]
CleanupEndpointSecret: $[ dependencies.filevalidation.outputs['wingetsetup.cleanupEndpoint']]
steps:

# Set label in GitHub PullRequest.
- task: AzureFunction@1
displayName: 'Set Label'
condition: eq(variables['PackageManager.RepositoryType'], 'GitHub')
condition: eq(variables['WinGet.RepositoryType'], 'GitHub')
inputs:
function: '$(LabelEndpointSecret)'
key: '$(HostKeySecret)'
Expand Down

0 comments on commit e47406f

Please sign in to comment.