Skip to content

Commit 969f761

Browse files
authored
Add official build queue-time parameters for test builds (#10730)
* Test conditional 1es template * Update test condition * Update test condition * update parameter names * Fix unofficial template * Update official branch conditions * Add signFiles parameter
1 parent f003627 commit 969f761

File tree

2 files changed

+59
-29
lines changed

2 files changed

+59
-29
lines changed

eng/ci/official-build.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
parameters:
2+
- name: forceOfficial # this is used for testing the official CI from non-official branches.
3+
displayName: Use official templates for non-official branches
4+
type: boolean
5+
default: false
6+
- name: runTests
7+
displayName: Run tests (ignored for official branches)
8+
type: boolean
9+
default: true
10+
- name: signFiles
11+
displayName: Sign files (ignored for official branches)
12+
type: boolean
13+
default: false
14+
115
trigger:
216
batch: true
317
branches:
@@ -34,11 +48,22 @@ resources:
3448
variables:
3549
- template: /eng/ci/templates/variables/build.yml@self
3650
- template: /ci/variables/cfs.yml@eng
37-
- name: buildNumber
38-
value: $[ counter('build', 23000) ] # 23000 selected to be ahead of current host build
51+
- name: OfficialBranch
52+
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/dev'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/internal/release/')) }}:
53+
value: true
54+
${{ else }}:
55+
value: false
56+
- name: '1ESTemplate'
57+
# force official to be true if an official branch. Otherwise respect the official parameter.
58+
${{ if or(eq(variables.OfficialBranch, true), eq(parameters.forceOfficial, true)) }}:
59+
value: 'v1/1ES.Official.PipelineTemplate.yml@1es'
60+
${{ else }}:
61+
value: 'v1/1ES.Unofficial.PipelineTemplate.yml@1es'
62+
- name: SignFiles # variable for access in other templates
63+
value: ${{ or(eq(variables.OfficialBranch, true), eq(parameters.signFiles, true)) }}
3964

4065
extends:
41-
template: v1/1ES.Official.PipelineTemplate.yml@1es
66+
template: ${{ variables['1ESTemplate'] }}
4267
parameters:
4368
pool:
4469
name: 1es-pool-azfunc
@@ -56,7 +81,9 @@ extends:
5681
- template: /eng/ci/templates/official/jobs/build-artifacts-windows.yml@self
5782
- template: /eng/ci/templates/official/jobs/build-artifacts-linux.yml@self
5883

84+
# tests are always ran for official branches
5985
- stage: Test
86+
condition: ${{ or(eq(variables.OfficialBranch, true), eq(parameters.runTests, true)) }}
6087
dependsOn: ''
6188

6289
jobs:

eng/ci/templates/official/jobs/build-artifacts-windows.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ jobs:
6161
**/ExtensionsMetadataGenerator.csproj
6262
**/WebJobs.Script.Abstractions.csproj
6363
64-
- template: ci/sign-files.yml@eng
65-
parameters:
66-
displayName: Sign Abstractions assemblies
67-
folderPath: out/bin/WebJobs.Script.Abstractions/release
68-
pattern: Microsoft.Azure.WebJobs.Script.Abstractions*.dll
69-
signType: dll
64+
- ${{ if eq(variables.SignFiles, true) }}:
65+
- template: ci/sign-files.yml@eng
66+
parameters:
67+
displayName: Sign Abstractions assemblies
68+
folderPath: out/bin/WebJobs.Script.Abstractions/release
69+
pattern: Microsoft.Azure.WebJobs.Script.Abstractions*.dll
70+
signType: dll
7071

7172
- task: DotNetCoreCLI@2
7273
displayName: Pack Abstractions
@@ -77,12 +78,13 @@ jobs:
7778
projects: |
7879
**/WebJobs.Script.Abstractions.csproj
7980
80-
- template: ci/sign-files.yml@eng
81-
parameters:
82-
displayName: Sign ExtensionsMetadataGenerator assemblies
83-
folderPath: out/bin/ExtensionsMetadataGenerator
84-
pattern: Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator*.dll
85-
signType: dll-strong-name
81+
- ${{ if eq(variables.SignFiles, true) }}:
82+
- template: ci/sign-files.yml@eng
83+
parameters:
84+
displayName: Sign ExtensionsMetadataGenerator assemblies
85+
folderPath: out/bin/ExtensionsMetadataGenerator
86+
pattern: Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator*.dll
87+
signType: dll-strong-name
8688

8789
- task: DotNetCoreCLI@2
8890
displayName: Pack ExtensionsMetadataGenerator
@@ -93,19 +95,20 @@ jobs:
9395
projects: |
9496
**/ExtensionsMetadataGenerator.csproj
9597
96-
- template: ci/sign-files.yml@eng
97-
parameters:
98-
displayName: Sign NugetPackages
99-
folderPath: $(nuget_package_path)
100-
pattern: '*.nupkg'
101-
signType: nuget
98+
- ${{ if eq(variables.SignFiles, true) }}:
99+
- template: ci/sign-files.yml@eng
100+
parameters:
101+
displayName: Sign NugetPackages
102+
folderPath: $(nuget_package_path)
103+
pattern: '*.nupkg'
104+
signType: nuget
102105

103-
- task: DeleteFiles@1
104-
displayName: Delete CodeSignSummary files
105-
inputs:
106-
contents: '**/CodeSignSummary-*.md'
106+
- task: DeleteFiles@1
107+
displayName: Delete CodeSignSummary files
108+
inputs:
109+
contents: '**/CodeSignSummary-*.md'
107110

108-
- task: DeleteFiles@1
109-
displayName: Delete CodeSignSummary files
110-
inputs:
111-
contents: '$(nuget_package_path)/**/CodeSignSummary-*.md'
111+
- task: DeleteFiles@1
112+
displayName: Delete CodeSignSummary files
113+
inputs:
114+
contents: '$(nuget_package_path)/**/CodeSignSummary-*.md'

0 commit comments

Comments
 (0)