diff --git a/eng/pipelines/templates/jobs/vmr-synchronization.yml b/eng/pipelines/templates/jobs/vmr-synchronization.yml index 713deea20..ae950fd34 100644 --- a/eng/pipelines/templates/jobs/vmr-synchronization.yml +++ b/eng/pipelines/templates/jobs/vmr-synchronization.yml @@ -19,10 +19,13 @@ parameters: jobs: - job: Synchronize_VMR - displayName: Synchronize dotnet/dotnet + displayName: Synchronize VMR's ${{ parameters.vmrBranch }} timeoutInMinutes: 120 variables: - - template: /eng/common/templates/variables/pool-providers.yml + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - template: /eng/common/templates/variables/pool-providers.yml + - ${{ else }}: + - template: /eng/common/templates-official/variables/pool-providers.yml - name: vmrPath value: $(Agent.BuildDirectory)/vmr - ${{ if not(parameters.noPush) }}: @@ -36,20 +39,21 @@ jobs: - group: DotNetBot-AzDO-PAT - name: vmrInternalUrl value: https://dnceng@dev.azure.com/dnceng/internal/_git/dotnet-dotnet - + pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals Build.Ubuntu.2004.Amd64.Open - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + image: 1es-ubuntu-2004-open + os: linux + ${{ else }}: name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals Build.Ubuntu.2004.Amd64 + demands: ImageOverride -equals 1es-ubuntu-2004 + os: linux steps: - template: ../steps/vmr-prepare.yml parameters: vmrBranch: ${{ parameters.vmrBranch }} - isBuiltFromVmr: false - template: ../steps/vmr-pull-updates.yml parameters: @@ -57,7 +61,6 @@ jobs: vmrBranch: ${{ parameters.vmrBranch }} targetRef: ${{ parameters.targetRef }} - - ${{ if and(not(parameters.noPush), not(in(variables['Build.Reason'], 'PullRequest')), eq(variables['System.TeamProject'], 'internal')) }}: # Push main and release branches to the public VMR - ${{ if or(eq(parameters.vmrBranch, 'main'), startsWith(parameters.vmrBranch, 'release/')) }}: @@ -83,4 +86,4 @@ jobs: --azdev-pat '$(dn-bot-dnceng-build-rw-code-rw)' --verbose displayName: Push changes to dotnet-dotnet (internal) - workingDirectory: $(Agent.BuildDirectory)/installer \ No newline at end of file + workingDirectory: $(Agent.BuildDirectory)/installer diff --git a/eng/pipelines/vmr-sync-internal.yml b/eng/pipelines/vmr-sync-internal.yml index 0a10a518e..02d474907 100644 --- a/eng/pipelines/vmr-sync-internal.yml +++ b/eng/pipelines/vmr-sync-internal.yml @@ -17,21 +17,46 @@ resources: name: dotnet-dotnet ref: $(Build.SourceBranch) + - repository: 1ESPipelineTemplates + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + parameters: - name: vmrBranch displayName: dotnet-dotnet branch to push to type: string default: ' ' -variables: +variables: - ${{ if ne(parameters.vmrBranch, ' ') }}: - name: VmrBranch value: ${{ replace(parameters.vmrBranch, ' ', '') }} - ${{ else }}: - name: VmrBranch value: ${{ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), 'refs/pull/', '') }} - -jobs: - - template: templates/jobs/vmr-synchronization.yml - parameters: - vmrBranch: ${{ variables.VmrBranch }} \ No newline at end of file + +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates + parameters: + sdl: + sourceAnalysisPool: + name: $(DncEngInternalBuildPool) + image: 1es-windows-2022 + os: windows + + sourceRepositoriesToScan: + exclude: + - repository: vmr + + componentgovernance: + sourceScanPath: $(Agent.BuildDirectory)/vmr + ignoreDirectories: $(Agent.BuildDirectory)/vmr/src + + stages: + - stage: VMRSynchronization + displayName: VMR Synchronization + jobs: + - template: /eng/pipelines/templates/jobs/vmr-synchronization.yml@self + parameters: + vmrBranch: ${{ variables.VmrBranch }} \ No newline at end of file diff --git a/eng/pipelines/vmr-sync.yml b/eng/pipelines/vmr-sync.yml index 6659887f1..7cdab71f3 100644 --- a/eng/pipelines/vmr-sync.yml +++ b/eng/pipelines/vmr-sync.yml @@ -19,23 +19,46 @@ resources: endpoint: dotnet ref: $(Build.SourceBranch) + - repository: 1ESPipelineTemplates + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + parameters: - name: vmrBranch displayName: dotnet/dotnet branch to push to type: string default: ' ' -variables: +variables: - ${{ if ne(parameters.vmrBranch, ' ') }}: - name: VmrBranch value: ${{ replace(parameters.vmrBranch, ' ', '') }} - ${{ else }}: - name: VmrBranch value: ${{ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), 'refs/pull/', '') }} - -jobs: - - template: /eng/pipelines/templates/jobs/vmr-synchronization.yml - parameters: - vmrBranch: ${{ variables.VmrBranch }} - - \ No newline at end of file + +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates + parameters: + sdl: + sourceAnalysisPool: + name: $(DncEngInternalBuildPool) + image: 1es-windows-2022 + os: windows + + sourceRepositoriesToScan: + exclude: + - repository: vmr + + componentgovernance: + sourceScanPath: $(Agent.BuildDirectory)/vmr + ignoreDirectories: $(Agent.BuildDirectory)/vmr/src + + stages: + - stage: VMRSynchronization + displayName: VMR Synchronization + jobs: + - template: /eng/pipelines/templates/jobs/vmr-synchronization.yml@self + parameters: + vmrBranch: ${{ variables.VmrBranch }}