From 10528eca71067c490b2120338e527330ef087dee Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Mon, 9 Sep 2024 11:00:08 -0700 Subject: [PATCH] Refactor prepare pipelines (#8929) --- .../templates/jobs/prepare-pipelines.yml | 401 +++++++++--------- eng/pipelines/pipeline-generation-single.yml | 65 +-- eng/pipelines/pipeline-generation.yml | 234 +--------- 3 files changed, 247 insertions(+), 453 deletions(-) diff --git a/eng/common/pipelines/templates/jobs/prepare-pipelines.yml b/eng/common/pipelines/templates/jobs/prepare-pipelines.yml index f2cbb2e931e..2387c962456 100644 --- a/eng/common/pipelines/templates/jobs/prepare-pipelines.yml +++ b/eng/common/pipelines/templates/jobs/prepare-pipelines.yml @@ -2,29 +2,41 @@ parameters: - name: Repository type: string default: $(Build.Repository.Name) - - name: Prefix + - name: RepositoryPath type: string - - name: CIConventionOptions - type: string - default: '' - - name: UPConventionOptions - type: string - default: '' - - name: TestsConventionOptions - type: string - default: '' - - name: GenerateUnifiedWeekly - type: boolean - default: false + default: 'sdk' jobs: -- job: PreparePipelines +- job: + displayName: 'Prepare pipelines for ${{ parameters.Repository }}' pool: - name: azsdk-pool-mms-ubuntu-2204-general - vmImage: ubuntu-22.04 + name: $(LINUXPOOL) + vmImage: $(LINUXVMIMAGE) + + variables: + RepositoryPath: "$(System.DefaultWorkingDirectory)/${{ parameters.RepositoryPath }}" + ProjectForPRValidation: 'public' + Prefix: 'na' + DevOpsPath: 'na' + InternalVariableGroups: '' + GenerateUnifiedWeekly: '' + TestVariableGroups: '' + + # Standard set of variable groups for the Azure SDK repositories + AzureSDK_Maven_Release_Pipeline_Secrets: 1 + AzureSDK_Nuget_Release_Pipeline_Secrets: 13 + AzureSDK_CocoaPods_Release_Pipeline_Secrets: 98 + NPM_Registry_Authentication: 24 + Release_Secrets_for_GitHub: 58 + Secrets_for_Resource_Provisioner: 64 + APIReview_AutoCreate_Configurations: 93 + steps: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: + Repositories: + - Name: ${{ parameters.Repository }} + WorkingDirectory: $(System.DefaultWorkingDirectory) Paths: - 'sdk/**/*.yml' - '!sdk/**/test-recordings/*' @@ -33,183 +45,182 @@ jobs: - '!sdk/**/session-records/*' - template: /eng/common/pipelines/templates/steps/install-pipeline-generation.yml - template: /eng/common/pipelines/templates/steps/set-default-branch.yml - # This covers our public repos. - - ${{ if not(endsWith(parameters.Repository, '-pr'))}}: - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project public - --prefix ${{parameters.Prefix}} - --devopspath "\${{parameters.Prefix}}" - --path $(System.DefaultWorkingDirectory)/sdk - --endpoint Azure - --repository ${{parameters.Repository}} - --convention ci - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - ${{parameters.CIConventionOptions}} - displayName: Create CI Pipelines for Public Repository - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix ${{parameters.Prefix}} - --devopspath "\${{parameters.Prefix}}" - --path $(System.DefaultWorkingDirectory)/sdk - --endpoint Azure - --repository ${{parameters.Repository}} - --convention up - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - ${{parameters.UPConventionOptions}} - displayName: Create UP Pipelines for Public Repository - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix ${{parameters.Prefix}} - --devopspath "\${{parameters.Prefix}}" - --path $(System.DefaultWorkingDirectory)/sdk - --endpoint Azure - --repository ${{parameters.Repository}} - --convention tests - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - ${{parameters.TestsConventionOptions}} - displayName: Create Live Test Pipelines for Public Repository - condition: and(succeeded(), ne('${{parameters.TestsConventionOptions}}','')) - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix ${{parameters.Prefix}} - --devopspath "\${{parameters.Prefix}}" - --path $(System.DefaultWorkingDirectory)/sdk - --endpoint Azure - --repository ${{parameters.Repository}} - --convention testsweekly - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - ${{parameters.TestsConventionOptions}} - displayName: Create Weekly (Multi-Cloud) Live Test Pipelines for Public Repository - condition: and(succeeded(), ne('${{parameters.TestsConventionOptions}}','')) - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix ${{parameters.Prefix}} - --devopspath "\${{parameters.Prefix}}" - --path $(System.DefaultWorkingDirectory)/sdk - --endpoint Azure - --repository ${{parameters.Repository}} - --convention upweekly - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - ${{parameters.UPConventionOptions}} - displayName: Create Weekly (Multi-Cloud) Unified Test Pipelines for Public Repository - condition: and(succeeded(), eq(${{parameters.GenerateUnifiedWeekly}},true)) - # This covers our -pr repositories. - - ${{ if endsWith(parameters.Repository, '-pr')}}: - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix ${{parameters.Prefix}}-pr - --devopspath "\${{parameters.Prefix}}\pr" - --path $(System.DefaultWorkingDirectory)/sdk - --endpoint Azure - --repository ${{parameters.Repository}} - --convention ci - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - --no-schedule - ${{parameters.CIConventionOptions}} - displayName: Create CI Pipelines for Private Repository - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix ${{parameters.Prefix}}-pr - --devopspath "\${{parameters.Prefix}}\pr" - --path $(System.DefaultWorkingDirectory)/sdk - --endpoint Azure - --repository ${{parameters.Repository}} - --convention up - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - --no-schedule - ${{parameters.UPConventionOptions}} - displayName: Create UP Pipelines for Private Repository - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix ${{parameters.Prefix}}-pr - --devopspath "\${{parameters.Prefix}}\pr" - --path $(System.DefaultWorkingDirectory)/sdk - --endpoint Azure - --repository ${{parameters.Repository}} - --convention tests - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - --no-schedule - ${{parameters.TestsConventionOptions}} - displayName: Create Live Test Pipelines for Private Repository - condition: and(succeeded(), ne('${{parameters.TestsConventionOptions}}','')) + - pwsh: | + Write-Host "Setting up pipeline variables" + if ("${{ parameters.Repository }}" -match "Azure/azure-sdk-for-(?[^-]*)(?-pr)?") { + $prefix = $matches['prefix'] + $devOpsPath = "\$prefix" + if ($matches['pr']) { + $devOpsPath = "${devOpsPath}\pr" + $prefix = "${prefix}-pr" + Write-Host "##vso[task.setvariable variable=ProjectForPRValidation]internal" + } + Write-Host "Prefix = $prefix" + Write-Host "DevOpsPath = $devOpsPath" + Write-Host "##vso[task.setvariable variable=Prefix]$prefix" + Write-Host "##vso[task.setvariable variable=DevOpsPath]$devOpsPath" + } + else { + Write-Error "Repository name '${{ parameters.Repository }}' is not in the expected format." + exit 1 + } + + # Map the language prefix to the appropriate variable groups + switch ($prefix) + { + "java" { + $internalVariableGroups = '$(AzureSDK_Maven_Release_Pipeline_Secrets) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)' + $testVariableGroups = '$(Secrets_for_Resource_Provisioner)' + } + "android" { + $internalVariableGroups = '$(AzureSDK_Maven_Release_Pipeline_Secrets) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)' + } + "js" { + $internalVariableGroups = '$(NPM_Registry_Authentication) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)' + $testVariableGroups = '$(Secrets_for_Resource_Provisioner)' + } + "python" { + $internalVariableGroups = '$(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)' + $testVariableGroups = '$(Secrets_for_Resource_Provisioner)' + } + "net" { + $internalVariableGroups = '$(AzureSDK_Nuget_Release_Pipeline_Secrets) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)' + $testVariableGroups = '$(Secrets_for_Resource_Provisioner)' + } + "cpp" { + $internalVariableGroups = '$(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations) $(Secrets_for_Resource_Provisioner)' + } + "ios" { + $internalVariableGroups = '$(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations) $(Secrets_for_Resource_Provisioner) $(AzureSDK_CocoaPods_Release_Pipeline_Secrets)' + } + "go" { + $internalVariableGroups = '$(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations) $(Secrets_for_Resource_Provisioner)' + $generateUnifiedWeekly = 'true' + } + default { + Write-Error "Prefix '$prefix' is not recognized." + exit 1 + } + } + + Write-Host "InternalVariableGroups = $internalVariableGroups" + Write-Host "TestVariableGroups = $testVariableGroups" + Write-Host "GenerateUnifiedWeekly = $generateUnifiedWeekly" + Write-Host "##vso[task.setvariable variable=InternalVariableGroups]$internalVariableGroups" + Write-Host "##vso[task.setvariable variable=TestVariableGroups]$testVariableGroups" + Write-Host "##vso[task.setvariable variable=GenerateUnifiedWeekly]$generateUnifiedWeekly" + displayName: Setup pipeline generation variables + + - task: AzureCLI@2 + inputs: + azureSubscription: 'opensource-api-connection' + scriptType: pscore + scriptLocation: inlineScript + inlineScript: > + $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate + --organization azure-sdk + --project $(ProjectForPRValidation) + --prefix $(Prefix) + --devopspath "$(DevOpsPath)" + --path $(RepositoryPath) + --endpoint Azure + --repository ${{ parameters.Repository }} + --convention ci + --agentpool Hosted + --branch refs/heads/$(DefaultBranch) + --set-managed-variables + --debug + displayName: 'Generate ci pipelines for: ${{ parameters.Repository }}' + continueOnError: true + - task: AzureCLI@2 + inputs: + azureSubscription: 'opensource-api-connection' + scriptType: pscore + scriptLocation: inlineScript + inlineScript: > + $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate + --organization azure-sdk + --project internal + --prefix $(Prefix) + --devopspath "$(DevOpsPath)" + --path $(RepositoryPath) + --endpoint Azure + --repository ${{ parameters.Repository }} + --convention up + --agentpool Hosted + --branch refs/heads/$(DefaultBranch) + --set-managed-variables + --debug + --variablegroups $(InternalVariableGroups) $(TestVariableGroups) + displayName: 'Generate release pipelines for: ${{ parameters.Repository }}' + continueOnError: true + - task: AzureCLI@2 + inputs: + azureSubscription: 'opensource-api-connection' + scriptType: pscore + scriptLocation: inlineScript + inlineScript: > + $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate + --organization azure-sdk + --project internal + --prefix $(Prefix) + --devopspath "$(DevOpsPath)" + --path $(RepositoryPath) + --endpoint Azure + --repository ${{ parameters.Repository }} + --convention tests + --agentpool Hosted + --branch refs/heads/$(DefaultBranch) + --set-managed-variables + --debug + --variablegroups $(TestVariableGroups) + displayName: 'Generate test pipelines for: ${{ parameters.Repository }}' + condition: and(succeeded(), ne(variables['TestVariableGroups'],'')) + continueOnError: true + - task: AzureCLI@2 + inputs: + azureSubscription: 'opensource-api-connection' + scriptType: pscore + scriptLocation: inlineScript + inlineScript: > + $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate + --organization azure-sdk + --project internal + --prefix $(Prefix) + --devopspath "$(DevOpsPath)" + --path $(RepositoryPath) + --endpoint Azure + --repository ${{ parameters.Repository }} + --convention testsweekly + --agentpool Hosted + --branch refs/heads/$(DefaultBranch) + --set-managed-variables + --debug + --variablegroups $(TestVariableGroups) + displayName: 'Generate weekly test pipelines (multi-cloud) for: ${{ parameters.Repository }}' + condition: and(succeeded(), ne(variables['TestVariableGroups'],'')) + continueOnError: true + - task: AzureCLI@2 + inputs: + azureSubscription: 'opensource-api-connection' + scriptType: pscore + scriptLocation: inlineScript + inlineScript: > + $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate + --organization azure-sdk + --project internal + --prefix $(Prefix) + --devopspath "$(DevOpsPath)" + --path $(RepositoryPath) + --endpoint Azure + --repository ${{ parameters.Repository }} + --convention upweekly + --agentpool Hosted + --branch refs/heads/$(DefaultBranch) + --set-managed-variables + --debug + --variablegroups $(InternalVariableGroups) $(TestVariableGroups) + displayName: 'Generate weekly unified test pipelines (multi-cloud) for: ${{ parameters.Repository }}' + condition: and(succeeded(), ne(variables['GenerateUnifiedWeekly'],'')) + continueOnError: true diff --git a/eng/pipelines/pipeline-generation-single.yml b/eng/pipelines/pipeline-generation-single.yml index 270aa525218..880353e36a9 100644 --- a/eng/pipelines/pipeline-generation-single.yml +++ b/eng/pipelines/pipeline-generation-single.yml @@ -1,51 +1,26 @@ -# Variables defined in pipeline definition -# DevOpsProject - public, internal -# Branch - main -# Prefix - net, python, js, java, -pr -# RepositoryName - azure-sdk-for- -# DevOpsPath - $(Prefix)\pr -# ServiceDirectory - "", keyvault, storage, etc. -# PipelineConvention - ci, up, tests, testsweekly, upweekly -# AdditionalOptions - potentially add variablegroups via "--variablegroups x" - pr: none - trigger: none +parameters: +- name: Branch + type: string + default: main +- name: RepositoryName + type: string + default: azure-sdk-for- +- name: RepositoryPath + type: string + default: 'sdk/' + variables: - NugetSecurityAnalysisWarningLevel: none - skipComponentGovernanceDetection: true - DevOpsOrg: azure-sdk - PathFilter: $(Pipeline.Workspace)/$(RepositoryName)/sdk/$(ServiceDirectory) +- template: /eng/pipelines/templates/variables/image.yml +- name: NugetSecurityAnalysisWarningLevel + value: none +- name: skipComponentGovernanceDetection + value: true jobs: -- job: GeneratePipeline - pool: - name: azsdk-pool-mms-ubuntu-2204-general - vmImage: ubuntu-22.04 - steps: - - checkout: none - - template: /eng/common/pipelines/templates/steps/install-pipeline-generation.yml - - script: | - git clone --filter=blob:none --branch $(Branch) https://$(azuresdk-github-pat)@github.com/azure/$(RepositoryName) $(Pipeline.Workspace)/$(RepositoryName) - displayName: 'Clone repository: $(RepositoryName)' - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization $(DevOpsOrg) - --project $(DevOpsProject) - --prefix $(Prefix) - --devopspath "$(DevOpsPath)" - --path $(PathFilter) - --endpoint Azure - --repository Azure/$(RepositoryName) - --convention $(PipelineConvention) - --agentpool Hosted - --branch refs/heads/$(Branch) - --debug - $(AdditionalOptions) - displayName: 'Generate pipeline' +- template: /eng/common/pipelines/templates/jobs/prepare-pipelines.yml + parameters: + Repository: Azure/${{ parameters.RepositoryName }} + RepositoryPath: ${{ parameters.RepositoryPath }} diff --git a/eng/pipelines/pipeline-generation.yml b/eng/pipelines/pipeline-generation.yml index 8f651a015fd..56ceec2fb25 100644 --- a/eng/pipelines/pipeline-generation.yml +++ b/eng/pipelines/pipeline-generation.yml @@ -3,221 +3,29 @@ pr: none trigger: none variables: - NugetSecurityAnalysisWarningLevel: none - skipComponentGovernanceDetection: true - TestVariableGroups: '' +- template: /eng/pipelines/templates/variables/image.yml +- name: NugetSecurityAnalysisWarningLevel + value: none +- name: skipComponentGovernanceDetection + value: true +- name: TestVariableGroups + value: '' parameters: - - name: AzureSDK_Maven_Release_Pipeline_Secrets - default: 1 - - name: AzureSDK_Nuget_Release_Pipeline_Secrets - default: 13 - - name: AzureSDK_CocoaPods_Release_Pipeline_Secrets - default: 98 - - name: NPM_Registry_Authentication - default: 24 - - name: Release_Secrets_for_GitHub - default: 58 - - name: Secrets_for_Resource_Provisioner - default: 64 - - name: Release_Secrets_for_GitHubIO_Publishing - default: 76 - - name: APIReview_AutoCreate_Configurations - default: 93 +- name: Repositories + type: object + default: + - Azure/azure-sdk-for-java + - Azure/azure-sdk-for-android + - Azure/azure-sdk-for-js + - Azure/azure-sdk-for-python + - Azure/azure-sdk-for-net + - Azure/azure-sdk-for-cpp + - Azure/azure-sdk-for-ios + - Azure/azure-sdk-for-go jobs: -- job: GeneratePipelines - pool: - name: azsdk-pool-mms-ubuntu-2204-general - vmImage: ubuntu-22.04 - timeoutInMinutes: 120 - strategy: - matrix: - Java: - RepositoryName: azure-sdk-for-java - Prefix: java - InternalVariableGroups: >- - ${{ parameters.AzureSDK_Maven_Release_Pipeline_Secrets }} - ${{ parameters.Release_Secrets_for_GitHub }} - ${{ parameters.Release_Secrets_for_GitHubIO_Publishing }} - ${{ parameters.APIReview_AutoCreate_Configurations }} - TestVariableGroups: '${{ parameters.Secrets_for_Resource_Provisioner }}' - Android: - RepositoryName: azure-sdk-for-android - Prefix: android - InternalVariableGroups: >- - ${{ parameters.AzureSDK_Maven_Release_Pipeline_Secrets }} - ${{ parameters.Release_Secrets_for_GitHub }} - ${{ parameters.Release_Secrets_for_GitHubIO_Publishing }} - ${{ parameters.APIReview_AutoCreate_Configurations }} - JavaScript: - RepositoryName: azure-sdk-for-js - Prefix: js - InternalVariableGroups: >- - ${{ parameters.NPM_Registry_Authentication }} - ${{ parameters.Release_Secrets_for_GitHub }} - ${{ parameters.Release_Secrets_for_GitHubIO_Publishing }} - ${{ parameters.APIReview_AutoCreate_Configurations }} - TestVariableGroups: '${{ parameters.Secrets_for_Resource_Provisioner }}' - Python: - RepositoryName: azure-sdk-for-python - Prefix: python - InternalVariableGroups: >- - ${{ parameters.Release_Secrets_for_GitHub }} - ${{ parameters.Release_Secrets_for_GitHubIO_Publishing }} - ${{ parameters.APIReview_AutoCreate_Configurations }} - TestVariableGroups: '${{ parameters.Secrets_for_Resource_Provisioner }}' - Net: - RepositoryName: azure-sdk-for-net - Prefix: net - InternalVariableGroups: >- - ${{ parameters.AzureSDK_Nuget_Release_Pipeline_Secrets }} - ${{ parameters.Release_Secrets_for_GitHub }} - ${{ parameters.Release_Secrets_for_GitHubIO_Publishing }} - ${{ parameters.APIReview_AutoCreate_Configurations }} - TestVariableGroups: '${{ parameters.Secrets_for_Resource_Provisioner }}' - Cpp: - RepositoryName: azure-sdk-for-cpp - Prefix: cpp - # Resource Provisioner is in InternalVariableGroups and not TestVariableGroups because C++ includes live tests in the unified pipelines - InternalVariableGroups: >- - ${{ parameters.Release_Secrets_for_GitHub }} - ${{ parameters.Release_Secrets_for_GitHubIO_Publishing }} - ${{ parameters.APIReview_AutoCreate_Configurations }} - ${{ parameters.Secrets_for_Resource_Provisioner }} - iOS: - RepositoryName: azure-sdk-for-ios - Prefix: ios - # Resource Provisioner is in InternalVariableGroups and not TestVariableGroups because iOS includes live tests in the unified pipelines - InternalVariableGroups: >- - ${{ parameters.Release_Secrets_for_GitHub }} - ${{ parameters.Release_Secrets_for_GitHubIO_Publishing }} - ${{ parameters.APIReview_AutoCreate_Configurations }} - ${{ parameters.Secrets_for_Resource_Provisioner }} - ${{ parameters.AzureSDK_CocoaPods_Release_Pipeline_Secrets}} - Go: - RepositoryName: azure-sdk-for-go - Prefix: go - # Resource Provisioner is in InternalVariableGroups and not TestVariableGroups because Go includes live tests in the unified pipelines - InternalVariableGroups: >- - ${{ parameters.Release_Secrets_for_GitHub }} - ${{ parameters.Release_Secrets_for_GitHubIO_Publishing }} - ${{ parameters.APIReview_AutoCreate_Configurations }} - ${{ parameters.Secrets_for_Resource_Provisioner }} - GenerateUnifiedWeekly: true - steps: - - template: /eng/common/pipelines/templates/steps/install-pipeline-generation.yml - - script: | - git clone https://github.com/azure/$(RepositoryName) $(Pipeline.Workspace)/$(RepositoryName) - displayName: 'Clone repository: $(RepositoryName)' - - template: /eng/common/pipelines/templates/steps/set-default-branch.yml +- ${{ each repo in parameters.Repositories }}: + - template: /eng/common/pipelines/templates/jobs/prepare-pipelines.yml parameters: - WorkingDirectory: $(Pipeline.Workspace)/$(RepositoryName) - - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project public - --prefix $(Prefix) - --path $(Pipeline.Workspace)/$(RepositoryName)/sdk - --endpoint Azure - --repository Azure/$(RepositoryName) - --convention ci - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - displayName: 'Generate public pipelines for: $(RepositoryName)' - - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix $(Prefix) - --path $(Pipeline.Workspace)/$(RepositoryName)/sdk - --endpoint Azure - --repository Azure/$(RepositoryName) - --convention up - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - --variablegroups $(InternalVariableGroups) $(TestVariableGroups) - displayName: 'Generate internal pipelines for: $(RepositoryName)' - - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix $(Prefix) - --path $(Pipeline.Workspace)/$(RepositoryName)/sdk - --endpoint Azure - --repository Azure/$(RepositoryName) - --convention tests - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - --variablegroups $(TestVariableGroups) - displayName: 'Generate test pipelines for: $(RepositoryName)' - condition: and(succeeded(), ne(variables['TestVariableGroups'],'')) - - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix $(Prefix) - --path $(Pipeline.Workspace)/$(RepositoryName)/sdk - --endpoint Azure - --repository Azure/$(RepositoryName) - --convention testsweekly - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - --variablegroups $(TestVariableGroups) - displayName: 'Generate weekly test pipelines (multi-cloud) for: $(RepositoryName)' - condition: and(succeeded(), ne(variables['TestVariableGroups'],'')) - - - task: AzureCLI@2 - inputs: - azureSubscription: 'opensource-api-connection' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: > - $(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate - --organization azure-sdk - --project internal - --prefix $(Prefix) - --path $(Pipeline.Workspace)/$(RepositoryName)/sdk - --endpoint Azure - --repository Azure/$(RepositoryName) - --convention upweekly - --agentpool Hosted - --branch refs/heads/$(DefaultBranch) - --set-managed-variables - --debug - --variablegroups $(InternalVariableGroups) $(TestVariableGroups) - displayName: 'Generate weekly unified test pipelines (multi-cloud) for: $(RepositoryName)' - condition: and(succeeded(), ne(variables['GenerateUnifiedWeekly'],'')) - + Repository: ${{ repo }}