forked from Azure/azure-functions-kafka-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yaml
160 lines (142 loc) · 5.49 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
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')]
# 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
continueOnError: false
pool:
name: 1ES-Hosted-Azfunc
demands:
- ImageOverride -equals MMSUbuntu20.04TLS
steps:
- task: DotNetCoreCLI@2
displayName: Build project
inputs:
projects: |
src/Microsoft.Azure.WebJobs.Extensions.Kafka/Microsoft.Azure.WebJobs.Extensions.Kafka.csproj
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: Bash@3
displayName: Start Kakfa in single node with Java and Python
inputs:
targetType: filePath
filePath: ./test/Microsoft.Azure.WebJobs.Extensions.Kafka.LangEndToEndTests/server/start-kafka-test-environment.sh
workingDirectory: test/Microsoft.Azure.WebJobs.Extensions.Kafka.LangEndToEndTests/server
- task: DotNetCoreCLI@2
displayName: Run language e2e tests
inputs:
command: test
projects: ./test/Microsoft.Azure.WebJobs.Extensions.Kafka.LangEndToEndTests
- script: dotnet pack -o '$(Build.ArtifactStagingDirectory)' --include-symbols src/Microsoft.Azure.WebJobs.Extensions.Kafka/Microsoft.Azure.WebJobs.Extensions.Kafka.csproj
displayName: Pack NuGet package
- 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