Skip to content

Commit

Permalink
Add official build queue-time parameters for test builds (#10730)
Browse files Browse the repository at this point in the history
* Test conditional 1es template

* Update test condition

* Update test condition

* update parameter names

* Fix unofficial template

* Update official branch conditions

* Add signFiles parameter
  • Loading branch information
jviau authored Jan 10, 2025
1 parent f003627 commit 969f761
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 29 deletions.
33 changes: 30 additions & 3 deletions eng/ci/official-build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
parameters:
- name: forceOfficial # this is used for testing the official CI from non-official branches.
displayName: Use official templates for non-official branches
type: boolean
default: false
- name: runTests
displayName: Run tests (ignored for official branches)
type: boolean
default: true
- name: signFiles
displayName: Sign files (ignored for official branches)
type: boolean
default: false

trigger:
batch: true
branches:
Expand Down Expand Up @@ -34,11 +48,22 @@ resources:
variables:
- template: /eng/ci/templates/variables/build.yml@self
- template: /ci/variables/cfs.yml@eng
- name: buildNumber
value: $[ counter('build', 23000) ] # 23000 selected to be ahead of current host build
- name: OfficialBranch
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/dev'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/internal/release/')) }}:
value: true
${{ else }}:
value: false
- name: '1ESTemplate'
# force official to be true if an official branch. Otherwise respect the official parameter.
${{ if or(eq(variables.OfficialBranch, true), eq(parameters.forceOfficial, true)) }}:
value: 'v1/1ES.Official.PipelineTemplate.yml@1es'
${{ else }}:
value: 'v1/1ES.Unofficial.PipelineTemplate.yml@1es'
- name: SignFiles # variable for access in other templates
value: ${{ or(eq(variables.OfficialBranch, true), eq(parameters.signFiles, true)) }}

extends:
template: v1/1ES.Official.PipelineTemplate.yml@1es
template: ${{ variables['1ESTemplate'] }}
parameters:
pool:
name: 1es-pool-azfunc
Expand All @@ -56,7 +81,9 @@ extends:
- template: /eng/ci/templates/official/jobs/build-artifacts-windows.yml@self
- template: /eng/ci/templates/official/jobs/build-artifacts-linux.yml@self

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

jobs:
Expand Down
55 changes: 29 additions & 26 deletions eng/ci/templates/official/jobs/build-artifacts-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ jobs:
**/ExtensionsMetadataGenerator.csproj
**/WebJobs.Script.Abstractions.csproj
- template: ci/sign-files.yml@eng
parameters:
displayName: Sign Abstractions assemblies
folderPath: out/bin/WebJobs.Script.Abstractions/release
pattern: Microsoft.Azure.WebJobs.Script.Abstractions*.dll
signType: dll
- ${{ if eq(variables.SignFiles, true) }}:
- template: ci/sign-files.yml@eng
parameters:
displayName: Sign Abstractions assemblies
folderPath: out/bin/WebJobs.Script.Abstractions/release
pattern: Microsoft.Azure.WebJobs.Script.Abstractions*.dll
signType: dll

- task: DotNetCoreCLI@2
displayName: Pack Abstractions
Expand All @@ -77,12 +78,13 @@ jobs:
projects: |
**/WebJobs.Script.Abstractions.csproj
- template: ci/sign-files.yml@eng
parameters:
displayName: Sign ExtensionsMetadataGenerator assemblies
folderPath: out/bin/ExtensionsMetadataGenerator
pattern: Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator*.dll
signType: dll-strong-name
- ${{ if eq(variables.SignFiles, true) }}:
- template: ci/sign-files.yml@eng
parameters:
displayName: Sign ExtensionsMetadataGenerator assemblies
folderPath: out/bin/ExtensionsMetadataGenerator
pattern: Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator*.dll
signType: dll-strong-name

- task: DotNetCoreCLI@2
displayName: Pack ExtensionsMetadataGenerator
Expand All @@ -93,19 +95,20 @@ jobs:
projects: |
**/ExtensionsMetadataGenerator.csproj
- template: ci/sign-files.yml@eng
parameters:
displayName: Sign NugetPackages
folderPath: $(nuget_package_path)
pattern: '*.nupkg'
signType: nuget
- ${{ if eq(variables.SignFiles, true) }}:
- template: ci/sign-files.yml@eng
parameters:
displayName: Sign NugetPackages
folderPath: $(nuget_package_path)
pattern: '*.nupkg'
signType: nuget

- task: DeleteFiles@1
displayName: Delete CodeSignSummary files
inputs:
contents: '**/CodeSignSummary-*.md'
- task: DeleteFiles@1
displayName: Delete CodeSignSummary files
inputs:
contents: '**/CodeSignSummary-*.md'

- task: DeleteFiles@1
displayName: Delete CodeSignSummary files
inputs:
contents: '$(nuget_package_path)/**/CodeSignSummary-*.md'
- task: DeleteFiles@1
displayName: Delete CodeSignSummary files
inputs:
contents: '$(nuget_package_path)/**/CodeSignSummary-*.md'

0 comments on commit 969f761

Please sign in to comment.