Skip to content

Commit 2136755

Browse files
dagoodakoeplinger
authored andcommitted
Source-build template default pool fix; clean up parameters (dotnet#6790)
* Rename runSourceBuild -> enableSourceBuild The 'enable*' properties are more common. * Set up default container host pool * Use default platform iff 0 platforms passed
1 parent 8494241 commit 2136755

3 files changed

Lines changed: 23 additions & 17 deletions

File tree

eng/common/templates/job/source-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ parameters:
2828
# container and pool.
2929
platform: {}
3030

31+
# The default VM host AzDO pool. This should be capable of running Docker containers: almost all
32+
# source-build builds run in Docker, including the default managed platform.
33+
defaultContainerHostPool:
34+
vmImage: ubuntu-20.04
35+
3136
jobs:
3237
- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }}
3338
displayName: Source-Build (${{ parameters.platform.name }})
@@ -37,6 +42,9 @@ jobs:
3742

3843
${{ if ne(parameters.platform.container, '') }}:
3944
container: ${{ parameters.platform.container }}
45+
46+
${{ if eq(parameters.platform.pool, '') }}:
47+
pool: ${{ parameters.defaultContainerHostPool }}
4048
${{ if ne(parameters.platform.pool, '') }}:
4149
pool: ${{ parameters.platform.pool }}
4250

eng/common/templates/jobs/jobs.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ parameters:
77

88
# Optional: Enable publishing using release pipelines
99
enablePublishUsingPipelines: false
10-
10+
11+
# Optional: Enable running the source-build jobs to build repo from source
12+
enableSourceBuild: false
13+
14+
# Optional: Parameters for source-build template.
15+
# See /eng/common/templates/jobs/source-build.yml for options
16+
sourceBuildParameters: []
17+
1118
graphFileGeneration:
1219
# Optional: Enable generating the graph files at the end of the build
1320
enabled: false
@@ -24,13 +31,6 @@ parameters:
2431
# if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects.
2532
runAsPublic: false
2633

27-
# Optional: Enable running the source-build jobs to build repo from source
28-
runSourceBuild: false
29-
30-
# Optional: Parameters for source-build template.
31-
# See /eng/common/templates/jobs/source-build.yml for options
32-
sourceBuildParameters: []
33-
3434
enableSourceIndex: false
3535
sourceIndexParams: {}
3636

@@ -53,7 +53,7 @@ jobs:
5353

5454
name: ${{ job.job }}
5555

56-
- ${{ if eq(parameters.runSourceBuild, true) }}:
56+
- ${{ if eq(parameters.enableSourceBuild, true) }}:
5757
- template: /eng/common/templates/jobs/source-build.yml
5858
parameters:
5959
allCompletedJobId: Source_Build_Complete
@@ -80,7 +80,7 @@ jobs:
8080
- ${{ if eq(parameters.publishBuildAssetsDependsOn, '') }}:
8181
- ${{ each job in parameters.jobs }}:
8282
- ${{ job.job }}
83-
- ${{ if eq(parameters.runSourceBuild, true) }}:
83+
- ${{ if eq(parameters.enableSourceBuild, true) }}:
8484
- Source_Build_Complete
8585
pool:
8686
vmImage: vs2017-win2016

eng/common/templates/jobs/source-build.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ parameters:
1111
# See /eng/common/templates/job/source-build.yml
1212
jobNamePrefix: 'Source_Build'
1313

14-
# If changed to true, causes this template to include the default platform for a managed-only
15-
# repo. The exact Docker image used for this build will be provided by Arcade. This has some risk,
16-
# but since the repo is supposed to be managed-only, the risk should be very low.
17-
includeDefaultManagedPlatform: false
14+
# This is the default platform provided by Arcade, intended for use by a managed-only repo.
1815
defaultManagedPlatform:
1916
name: 'Managed'
2017
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'
2118

2219
# Defines the platforms on which to run build jobs. One job is created for each platform, and the
23-
# object in this array is sent to the job template as 'platform'.
20+
# object in this array is sent to the job template as 'platform'. If no platforms are specified,
21+
# one job runs on 'defaultManagedPlatform'.
2422
platforms: []
2523

2624
jobs:
@@ -32,7 +30,7 @@ jobs:
3230
dependsOn:
3331
- ${{ each platform in parameters.platforms }}:
3432
- ${{ parameters.jobNamePrefix }}_${{ platform.name }}
35-
- ${{ if eq(parameters.includeDefaultManagedPlatform, true) }}:
33+
- ${{ if eq(length(parameters.platforms), 0) }}:
3634
- ${{ parameters.jobNamePrefix }}_${{ parameters.defaultManagedPlatform.name }}
3735

3836
- ${{ each platform in parameters.platforms }}:
@@ -41,7 +39,7 @@ jobs:
4139
jobNamePrefix: ${{ parameters.jobNamePrefix }}
4240
platform: ${{ platform }}
4341

44-
- ${{ if eq(parameters.includeDefaultManagedPlatform, true) }}:
42+
- ${{ if eq(length(parameters.platforms), 0) }}:
4543
- template: /eng/common/templates/job/source-build.yml
4644
parameters:
4745
jobNamePrefix: ${{ parameters.jobNamePrefix }}

0 commit comments

Comments
 (0)