-
Notifications
You must be signed in to change notification settings - Fork 81
/
azure-pipelines.yaml
203 lines (182 loc) · 6.77 KB
/
azure-pipelines.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: $(Build.SourceBranchName)_$(Build.Reason)_$(majorVersion).$(Build.BuildId)$(Rev:.r)
variables:
buildConfiguration: Release
majorVersion: 0.0.0
isReleaseTriggered: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/action/release')]
isMasterTriggered: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/master')]
Codeql.Enabled: true
# Enable PR validation on branches master and dev
pr:
branches:
include:
- master
- dev
# Enable CI on branches master and dev
# Batch builds
trigger:
batch: true
branches:
include:
- dev
- master
schedules:
- cron: '0 12 * * 0'
displayName: Weekly Sunday build
branches:
include:
- master
always: true
continueOnError: false
pool:
name: 1ES-Hosted-Azfunc
demands:
- ImageOverride -equals MMSUbuntu20.04TLS
steps:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: 3.1.x
packageType: sdk
- task: UseDotNet@2
displayName: 'Install .NET 6.0'
inputs:
version: 6.x
packageType: sdk
- task: DotNetCoreCLI@2
displayName: Build project
inputs:
command: 'build'
arguments: '--configuration Release -p:IsLocalBuild=False'
projects: src/Microsoft.Azure.WebJobs.Extensions.Kafka/Microsoft.Azure.WebJobs.Extensions.Kafka.csproj
- task: DotNetCoreCLI@2
displayName: Build test projects
inputs:
command: 'build'
arguments: '--configuration Release -p:IsLocalBuild=False'
projects: |
test/Microsoft.Azure.WebJobs.Extensions.Kafka.UnitTests/Microsoft.Azure.WebJobs.Extensions.Kafka.UnitTests.csproj
test/Microsoft.Azure.WebJobs.Extensions.Kafka.EndToEndTests/Microsoft.Azure.WebJobs.Extensions.Kafka.EndToEndTests.csproj
test/Microsoft.Azure.WebJobs.Extensions.Kafka.LangEndToEndTests/Microsoft.Azure.WebJobs.Extensions.Kafka.LangEndToEndTests.csproj
- task: DotNetCoreCLI@2
displayName: Run unit tests
inputs:
command: test
projects: ./test/Microsoft.Azure.WebJobs.Extensions.Kafka.UnitTests
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: Component Detection
- task: Bash@3
displayName: Start Kafka in single node
inputs:
targetType: filePath
filePath: ./test/Microsoft.Azure.WebJobs.Extensions.Kafka.EndToEndTests/start-kafka-test-environment.sh
workingDirectory: test/Microsoft.Azure.WebJobs.Extensions.Kafka.EndToEndTests
- task: DotNetCoreCLI@2
displayName: Run e2e tests
inputs:
command: test
projects: ./test/Microsoft.Azure.WebJobs.Extensions.Kafka.EndToEndTests
- task: Bash@3
displayName: Stop Kafka in single node
inputs:
targetType: filePath
filePath: ./test/Microsoft.Azure.WebJobs.Extensions.Kafka.EndToEndTests/stop-kafka-test-environment.sh
workingDirectory: test/Microsoft.Azure.WebJobs.Extensions.Kafka.EndToEndTests
- task: EsrpCodeSigning@1
displayName: Sign extension assembly
condition: and(succeeded(), eq(variables.isReleaseTriggered, 'True'))
inputs:
connectedServiceName: ESRP Service
folderPath: src/Microsoft.Azure.WebJobs.Extensions.Kafka/bin/Debug/netstandard2.0/
pattern: Microsoft.Azure.WebJobs.Extensions.Kafka.dll
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"",
"PageHash": "/NPH",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- task: Bash@3
displayName: Package current source as NuGet package and pack it in Docker
inputs:
targetType: filePath
filePath: ./script/create_package.sh
# - task: DotNetCoreCLI@2
# displayName: Run language e2e tests
# condition: and(succeeded(), eq(variables.isMasterTriggered, 'False')) # Skip in master until we fix the connections
# inputs:
# command: test
# projects: ./test/Microsoft.Azure.WebJobs.Extensions.Kafka.LangEndToEndTests
# env:
# AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
# AZURE_CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
# AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
# AZURE_TENANT_ID: $(AZURE_TENANT_ID)
# AzureWebJobsStorage: $(AzureWebJobsStorage)
# ConfluentBrokerList: $(ConfluentBrokerList)
# ConfluentCloudPassword: $(ConfluentCloudPassword)
# ConfluentCloudUsername: $(ConfluentCloudUsername)
# EventHubBrokerList: $(EventHubBrokerList)
# EventHubConnectionString: $(EventHubConnectionString)
# DisableConfluentTestsFlag: $(DisableConfluentTestsFlag)
# DisableEventHubsTestsFlag: $(DisableEventHubsTestsFlag)
- task: DotNetCoreCLI@2
displayName: Pack NuGet package
inputs:
command: pack
packDirectory: '$(Build.ArtifactStagingDirectory)'
searchPatternPack: src/Microsoft.Azure.WebJobs.Extensions.Kafka/Microsoft.Azure.WebJobs.Extensions.Kafka.csproj
configurationToPack: Release
includesymbols: true
- task: EsrpCodeSigning@1
displayName: Sign extension package
condition: and(succeeded(), eq(variables.isReleaseTriggered, 'True'))
inputs:
connectedServiceName: ESRP Service
folderPath: $(Build.ArtifactStagingDirectory)
pattern: Microsoft.Azure.WebJobs.Extensions.Kafka.*.nupkg
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode": "CP-230012",
"OperationCode": "NuGetSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationCode": "NuGetVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- task: ManifestGeneratorTask@0
displayName: SBOM Generation Task
inputs:
BuildDropPath: $(Build.ArtifactStagingDirectory)
PackageName: Microsoft.Azure.WebJobs.Extensions.Kafka
Verbosity: Information
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: drop
publishLocation: Container