diff options
author | Matt Galbraith <mattgal@windows.microsoft.com> | 2022-10-24 20:42:02 +0300 |
---|---|---|
committer | Matt Galbraith <mattgal@microsoft.com> | 2022-10-24 20:52:46 +0300 |
commit | c57564ebf3d8f967bd5c12cb266669ff820fcf30 (patch) | |
tree | 5e44e6a94f9e8643e868ba6066f6e06bf94a18d5 | |
parent | 06f87988a0b0c9eac84b07e04cec9990d1cb4a4f (diff) |
Bake the logic of selecting pool provider into source-bulid.yml, since we can't import a variable template in this template if the user of the template declares their own variablestest-yaml-tweak
-rw-r--r-- | eng/common/templates/job/source-build.yml | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/eng/common/templates/job/source-build.yml b/eng/common/templates/job/source-build.yml index 6fe2d737db..e40bf35203 100644 --- a/eng/common/templates/job/source-build.yml +++ b/eng/common/templates/job/source-build.yml @@ -34,8 +34,6 @@ parameters: jobs: - job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }} displayName: Source-Build (${{ parameters.platform.name }}) - variables: - - template: /eng/common/templates/variables/pool-providers.yml ${{ each property in parameters.platform.jobProperties }}: ${{ property.key }}: ${{ property.value }} @@ -46,13 +44,24 @@ jobs: ${{ if eq(parameters.platform.pool, '') }}: # The default VM host AzDO pool. This should be capable of running Docker containers: almost all # source-build builds run in Docker, including the default managed platform. + # /eng/common/templates/variables/pool-providers.yml can't be used here (some customers declare variables already), so duplicate its logic pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) + # Main environments + ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), true)) }}: + name: NetCore-Public demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: $(DncEngInternalBuildPool) + ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), true)) }}: + name: NetCore1ESPool-Internal demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 + + # Servicing build environments + ${{ if and(eq(variables['System.TeamProject'], 'public'), contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release')) }}: + name: NetCore-Svc-Public + demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open + ${{ if and(eq(variables['System.TeamProject'], 'internal'), contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release')) }}: + name: NetCore1ESPool-Svc-Internal + demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 + ${{ if ne(parameters.platform.pool, '') }}: pool: ${{ parameters.platform.pool }} |