forked from OpenTTD/CompileFarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-linux.yml
326 lines (295 loc) · 9.46 KB
/
azure-pipelines-linux.yml
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
trigger:
- master
# Only run this pipeline on a Pull Request if anything but the
# azure-pipeline-windows is modified; otherwise that pipeline can
# handle it just fine.
pr:
branches:
include:
- master
paths:
exclude:
- azure-pipelines-windows.yml
jobs:
- job: BaseImages
displayName: 'Base image'
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
linux-debian-stretch-i386:
Distro: i386/debian
Release: stretch-slim
Tag: linux-debian-stretch-i386
linux-debian-stretch-amd64:
Distro: debian
Release: stretch-slim
Tag: linux-debian-stretch-amd64
linux-debian-buster-i386:
Distro: i386/debian
Release: buster-slim
Tag: linux-debian-buster-i386
linux-debian-buster-amd64:
Distro: debian
Release: buster-slim
Tag: linux-debian-buster-amd64
linux-ubuntu-xenial-i386:
Distro: i386/ubuntu
Release: xenial
Tag: linux-ubuntu-xenial-i386
linux-ubuntu-xenial-amd64:
Distro: ubuntu
Release: xenial
Tag: linux-ubuntu-xenial-amd64
linux-ubuntu-bionic-i386:
Distro: i386/ubuntu
Release: bionic
Tag: linux-ubuntu-bionic-i386
linux-ubuntu-bionic-amd64:
Distro: ubuntu
Release: bionic
Tag: linux-ubuntu-bionic-amd64
# Focal does not have i386 architecture
linux-ubuntu-focal-amd64:
Distro: ubuntu
Release: focal
Tag: linux-ubuntu-focal-amd64
steps:
- checkout: self
submodules: true
- task: Docker@1
displayName: 'Build base image'
inputs:
dockerFile: base-linux/Dockerfile
arguments: '--build-arg DISTRO=$(Distro) --build-arg RELEASE=$(Release)'
imageName: 'openttd/base:$(Tag)'
addDefaultLabels: false
# Publish the images via artifacts
# Explicitly we do not publish them via Docker Hub as that would mean the CI
# updates production images, which is a bad idea.
- script: |
set -ex
mkdir base-images
docker save openttd/base:$(Tag) | gzip -c > base-$(Tag).tar.gz
displayName: 'Save base image'
- task: PublishBuildArtifacts@1
displayName: 'Publish base image'
inputs:
PathtoPublish: base-$(Tag).tar.gz
ArtifactName: base-images
- job: LinuxCI
dependsOn: BaseImages
displayName: 'Linux CI image'
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
commit-checker:
Folder: ci-commit-checker
Tag: commit-checker
linux-amd64-clang-3.8:
Folder: ci-linux-amd64-clang-3.8
Tag: linux-amd64-clang-3.8
linux-amd64-clang-3.9:
Folder: ci-linux-amd64-clang-3.9
Tag: linux-amd64-clang-3.9
linux-amd64-gcc-6:
Folder: ci-linux-amd64-gcc-6
Tag: linux-amd64-gcc-6
linux-i386-gcc-6:
Folder: ci-linux-i386-gcc-6
Tag: linux-i386-gcc-6
steps:
- checkout: self
submodules: true
# Get all the needed base images and load them
- task: DownloadBuildArtifacts@0
displayName: 'Download base images'
inputs:
downloadType: specific
itemPattern: |
base-images/base-linux-debian-stretch-i386.tar.gz
base-images/base-linux-debian-stretch-amd64.tar.gz
downloadPath: '$(System.ArtifactsDirectory)'
- script: |
set -ex
for i in $(System.ArtifactsDirectory)/base-images/*.tar.gz; do gunzip -c $i | docker load; done
displayName: 'Load base images'
- task: Docker@1
displayName: 'Build image'
inputs:
dockerFile: $(Folder)/Dockerfile
imageName: 'openttd/compile-farm-ci:$(Tag)'
addDefaultLabels: false
# Only publish when it triggered on 'master' (and not on a Pull Request)
- task: Docker@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'Publish image'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'OpenTTD Docker Hub'
command: 'Push an image'
imageName: 'openttd/compile-farm-ci:$(Tag)'
- job: LinuxDebRelease
dependsOn: BaseImages
displayName: 'Linux deb release images'
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
linux-debian-stretch-i386-gcc:
Distro: debian
Release: stretch
Arch: i386
Tag: linux-debian-stretch-i386-gcc
linux-debian-stretch-amd64-gcc:
Distro: debian
Release: stretch
Arch: amd64
Tag: linux-debian-stretch-amd64-gcc
linux-debian-buster-i386-gcc:
Distro: debian
Release: buster
Arch: i386
Tag: linux-debian-buster-i386-gcc
linux-debian-buster-amd64-gcc:
Distro: debian
Release: buster
Arch: amd64
Tag: linux-debian-buster-amd64-gcc
linux-ubuntu-xenial-i386-gcc:
Distro: ubuntu
Release: xenial
Arch: i386
Tag: linux-ubuntu-xenial-i386-gcc
linux-ubuntu-xenial-amd64-gcc:
Distro: ubuntu
Release: xenial
Arch: amd64
Tag: linux-ubuntu-xenial-amd64-gcc
linux-ubuntu-bionic-i386-gcc:
Distro: ubuntu
Release: bionic
Arch: i386
Tag: linux-ubuntu-bionic-i386-gcc
linux-ubuntu-bionic-amd64-gcc:
Distro: ubuntu
Release: bionic
Arch: amd64
Tag: linux-ubuntu-bionic-amd64-gcc
# Focal does not have i386 architecture
linux-ubuntu-focal-amd64-gcc:
Distro: ubuntu
Release: focal
Arch: amd64
Tag: linux-ubuntu-focal-amd64-gcc
steps:
- checkout: self
submodules: true
# Get all the needed base images and load them
- task: DownloadBuildArtifacts@0
displayName: 'Download base images'
inputs:
downloadType: specific
itemPattern: 'base-images/base-linux-$(Distro)-$(Release)-$(Arch).tar.gz'
downloadPath: '$(System.ArtifactsDirectory)'
- script: |
set -ex
for i in $(System.ArtifactsDirectory)/base-images/*.tar.gz; do gunzip -c $i | docker load; done
displayName: 'Load base images'
- task: Docker@1
displayName: 'Build image'
inputs:
dockerFile: release-linux-deb-gcc/Dockerfile
arguments: '--build-arg DISTRO=$(Distro) --build-arg RELEASE=$(Release) --build-arg ARCH=$(Arch)'
imageName: 'openttd/compile-farm:$(Tag)'
addDefaultLabels: false
# Only publish when it triggered on 'master' (and not on a Pull Request)
- task: Docker@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'Publish image'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'OpenTTD Docker Hub'
command: 'Push an image'
imageName: 'openttd/compile-farm:$(Tag)'
- job: LinuxGenericRelease
dependsOn: BaseImages
displayName: 'Linux generic release images'
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
linux-generic-i386-gcc:
Arch: i386
Tag: linux-generic-i386-gcc
linux-generic-amd64-gcc:
Arch: amd64
Tag: linux-generic-amd64-gcc
steps:
- checkout: self
submodules: true
# Get all the needed base images and load them
- task: DownloadBuildArtifacts@0
displayName: 'Download base images'
inputs:
downloadType: specific
itemPattern: |
base-images/base-linux-debian-stretch-i386.tar.gz
base-images/base-linux-debian-stretch-amd64.tar.gz
downloadPath: '$(System.ArtifactsDirectory)'
- script: |
set -ex
for i in $(System.ArtifactsDirectory)/base-images/*.tar.gz; do gunzip -c $i | docker load; done
displayName: 'Load base images'
- task: Docker@1
displayName: 'Build image'
inputs:
dockerFile: release-linux-generic-gcc/Dockerfile
arguments: '--build-arg ARCH=$(Arch)'
imageName: 'openttd/compile-farm:$(Tag)'
addDefaultLabels: false
# Only publish when it triggered on 'master' (and not on a Pull Request)
- task: Docker@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'Publish image'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'OpenTTD Docker Hub'
command: 'Push an image'
imageName: 'openttd/compile-farm:$(Tag)'
- job: Docs
dependsOn: BaseImages
displayName: 'Docs image'
pool:
vmImage: 'ubuntu-16.04'
steps:
- checkout: self
submodules: true
# Get all the needed base images and load them
- task: DownloadBuildArtifacts@0
displayName: 'Download base images'
inputs:
downloadType: specific
itemPattern: |
base-images/base-linux-debian-stretch-amd64.tar.gz
downloadPath: '$(System.ArtifactsDirectory)'
- script: |
set -ex
for i in $(System.ArtifactsDirectory)/base-images/*.tar.gz; do gunzip -c $i | docker load; done
displayName: 'Load base images'
- task: Docker@1
displayName: 'Build image'
inputs:
dockerFile: release-docs/Dockerfile
imageName: 'openttd/compile-farm:docs'
addDefaultLabels: false
# Only publish when it triggered on 'master' (and not on a Pull Request)
- task: Docker@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'Publish image'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'OpenTTD Docker Hub'
command: 'Push an image'
imageName: 'openttd/compile-farm:docs'