-
Notifications
You must be signed in to change notification settings - Fork 455
/
images-release.yaml
345 lines (344 loc) · 14.9 KB
/
images-release.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
name: $(version)
jobs:
################################################################################
- job: linux_dotnet_projects
################################################################################
# This job is run on a hosted linux agent, which needs dotnet 2 and 3 installed as a manual step.
# The code sign steps will fail unless we explicitly say to use dotnet 2 before.
# This means we have to toggle back and forth between primary dotnet installations for the sign and build.
# TODO: Investigate why we have to toggle primary installs on linux, when we didn't have to do this on windows (now removed).
timeoutInMinutes: 180
displayName: LinuxDotnet
pool:
vmImage: ubuntu-18.04
steps:
# Setup dependencies
- bash: |
docker login '$(build.registry.address)' --username '$(build.registry.user)' --password '$(build.registry.password)'
docker login '$(registry.address)' --username '$(registry.user)' --password '$(registry.password)'
displayName: 'Docker Login'
- task: Bash@3
displayName: Install Rust
inputs:
filePath: scripts/linux/generic-rust/install.sh
arguments: --project-root "edgelet" --package-arm
- bash: "echo \"##vso[task.setvariable variable=PATH;]$HOME/.cargo/bin:$PATH\""
displayName: "Modify path"
- template: ../templates/install-dotnet2.yaml
- template: ../templates/install-dotnet3.yaml
- template: ../templates/dotnet3-globaljson.yaml # use dotnet 3 as primary install for build
- bash: "cargo install --git https://github.com/arsing/cross.git --branch set-path"
displayName: "Install cross (fork with docker fix)"
# Build
- task: ShellScript@2
displayName: "Build Azure-IoT-Edge-Core"
inputs:
args: "-c Release"
scriptPath: scripts/linux/buildBranch.sh
- template: templates/build-broker-watchdog.yaml
- template: templates/consolidate-build-artifacts.yaml
# Code Sign
- template: ../templates/dotnet2-globaljson.yaml # switch to dotnet 2 as primary install for code sign
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: "Edge Agent Code Sign"
inputs:
ConnectedServiceName: "Azure IoT Edge Code Sign 2"
FolderPath: $(Build.BinariesDirectory)/publish/Microsoft.Azure.Devices.Edge.Agent.Service
Pattern: Microsoft.Azure.Devices.Edge.*.dll
SessionTimeout: 20
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "Append",
"parameterValue": "/as"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [
{
"parameterName": "VerifyAll",
"parameterValue": "/all"
}
],
"toolName": "sign",
"toolVersion": "1.0"
}
]
signConfigType: inlineSignParams
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: "Edge Hub Code Sign"
inputs:
ConnectedServiceName: "Azure IoT Edge Code Sign 2"
FolderPath: $(Build.BinariesDirectory)/publish/edge-hub/Microsoft.Azure.Devices.Edge.Hub.Service
Pattern: "Microsoft.Azure.Devices.Edge.*.dll,Microsoft.Azure.Devices.Routing.*.dll"
SessionTimeout: 20
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "Append",
"parameterValue": "/as"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [
{
"parameterName": "VerifyAll",
"parameterValue": "/all"
}
],
"toolName": "sign",
"toolVersion": "1.0"
}
]
signConfigType: inlineSignParams
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: "Temp Sensor Code Sign"
inputs:
ConnectedServiceName: "Azure IoT Edge Code Sign 2"
FolderPath: $(Build.BinariesDirectory)/publish/SimulatedTemperatureSensor
Pattern: "Microsoft.Azure.Devices.Edge.*.dll,SimulatedTemperatureSensor.dll"
SessionTimeout: 20
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "Append",
"parameterValue": "/as"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [
{
"parameterName": "VerifyAll",
"parameterValue": "/all"
}
],
"toolName": "sign",
"toolVersion": "1.0"
}
]
signConfigType: inlineSignParams
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: "Functions Binding Code Sign"
inputs:
ConnectedServiceName: "Azure IoT Edge Code Sign 2"
FolderPath: $(Build.BinariesDirectory)/publish/Microsoft.Azure.WebJobs.Extensions.EdgeHub
Pattern: Microsoft.Azure.WebJobs.Extensions*.dll
SessionTimeout: 20
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "Append",
"parameterValue": "/as"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [
{
"parameterName": "VerifyAll",
"parameterValue": "/all"
}
],
"toolName": "sign",
"toolVersion": "1.0"
}
]
signConfigType: inlineSignParams
- template: ../templates/dotnet3-globaljson.yaml # switch to dotnet 3 as primary install for nuget package
- task: DotNetCoreCLI@2
displayName: "Functions Binding nuget package"
inputs:
buildProperties: OutDir=$(Build.BinariesDirectory)/publish/Microsoft.Azure.WebJobs.Extensions.EdgeHub
command: pack
nobuild: true
packDirectory: $(Build.BinariesDirectory)/publish/
packagesToPack: "**/Microsoft.Azure.WebJobs.Extensions.EdgeHub.csproj"
versionEnvVar: version
versioningScheme: byEnvVar
- template: ../templates/dotnet2-globaljson.yaml # switch to dotnet 2 as primary install for code sign
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: "Functions Binding nuget package Sign"
inputs:
ConnectedServiceName: "Azure IoT Edge Code Sign 2"
FolderPath: $(Build.BinariesDirectory)/publish
Pattern: Microsoft.Azure.WebJobs.Extensions*.nupkg
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetSign",
"parameters": [],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetVerify",
"parameters": [],
"toolName": "sign",
"toolVersion": "1.0"
}
]
signConfigType: inlineSignParams
# Push images
- template: templates/image-linux.yaml
parameters:
imageName: azureiotedge-hub
name: "Edge Hub"
project: edge-hub
version: $(version)
- template: templates/image-linux.yaml
parameters:
imageName: azureiotedge-agent
name: "Edge Agent"
project: Microsoft.Azure.Devices.Edge.Agent.Service
version: $(version)
- template: templates/image-linux.yaml
parameters:
imageName: azureiotedge-simulated-temperature-sensor
name: "Temperature Sensor"
project: SimulatedTemperatureSensor
version: $(version)
- template: templates/image-linux.yaml
parameters:
imageName: azureiotedge-diagnostics
name: "Diagnostics Module"
project: IotedgeDiagnosticsDotnet
version: $(version)
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts to VSTS'
inputs:
PathtoPublish: '$(Build.BinariesDirectory)/publish'
ArtifactName: 'publish-linux'
################################################################################
- job: manifest
################################################################################
displayName: Publish Manifest Images
pool:
vmImage: 'ubuntu-18.04'
dependsOn:
- linux_dotnet_projects
steps:
- script: scripts/linux/buildManifest.sh -r '$(registry.address)' -u '$(registry.user)' -p '$(registry.password)' -v '$(version)' -t '$(System.DefaultWorkingDirectory)/edge-modules/iotedge-diagnostics-dotnet/docker/manifest.yaml.template' -n '$(namespace)' --tags '$(tags)'
displayName: 'Publish azureiotedge-diagnostics Manifest'
- script: scripts/linux/buildManifest.sh -r '$(registry.address)' -u '$(registry.user)' -p '$(registry.password)' -v '$(version)' -t '$(System.DefaultWorkingDirectory)/edge-agent/docker/manifest.yaml.template' -n '$(namespace)' --tags '$(tags)'
displayName: 'Publish Edge Agent Manifest'
- script: scripts/linux/buildManifest.sh -r '$(registry.address)' -u '$(registry.user)' -p '$(registry.password)' -v '$(version)' -t '$(System.DefaultWorkingDirectory)/edge-hub/docker/manifest.yaml.template' -n '$(namespace)' --tags '$(tags)'
displayName: 'Publish Edge Hub Manifest'
- script: scripts/linux/buildManifest.sh -r '$(registry.address)' -u '$(registry.user)' -p '$(registry.password)' -v '$(version)' -t '$(System.DefaultWorkingDirectory)/edge-modules/SimulatedTemperatureSensor/docker/manifest.yaml.template' -n '$(namespace)' --tags '$(tags)'
displayName: 'Publish Temperature Sensor Manifest'