forked from nextcloud/nextcloudpi
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
318 lines (268 loc) · 14.9 KB
/
.travis.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
stages:
- building_part1
- building_part2
- testing
- pushing_images
- pushing_manifest
sudo: required
language: generic
dist: xenial
branches:
only:
- gsoc2019-travis
# Only build tags
if: tag IS present
cache:
directories:
- docker_cached
jobs:
include:
- stage: building_part1
### x86 Docker images
env:
CACHE_NAME=X86
install:
- ./.travis/configure_docker.sh #upgrading docker
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
script:
- while sleep 9m; do echo "=====[ $SECONDS seconds, build-docker still building... ]====="; done &
- DOCKER_BUILDKIT=1 docker build . -f docker/debian-ncp/Dockerfile -t ownyourbits/debian-ncp-amd64:latest --pull --build-arg arch=amd64 --build-arg arch_qemu=x86_64 > output
- sed -i "/innodb_file_format=barracuda/a open_files_limit=65536" lamp.sh
- DOCKER_BUILDKIT=1 docker build . -f docker/lamp/Dockerfile -t ownyourbits/lamp-amd64:latest --build-arg arch=amd64 > output
- sed -i '/open_files_limit=65536/d' lamp.sh
- DOCKER_BUILDKIT=1 docker build . -f docker/nextcloud/Dockerfile -t ownyourbits/nextcloud-amd64:latest --build-arg arch=amd64 > output
- DOCKER_BUILDKIT=1 docker build . -f docker/nextcloudpi/Dockerfile -t ownyourbits/nextcloudpi-amd64:latest --build-arg arch=amd64 > output
- docker save --output docker_cached/debian-ncp-amd64.tar ownyourbits/debian-ncp-amd64:latest
- docker save --output docker_cached/lamp-amd64.tar ownyourbits/lamp-amd64:latest
- docker save --output docker_cached/nextcloud-amd64.tar ownyourbits/nextcloud-amd64:latest
- docker save --output docker_cached/nextcloudpi-amd64.tar ownyourbits/nextcloudpi-amd64:latest
-
### armhf Docker images
env:
CACHE_NAME=ARMHF
install:
- sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static
- ./.travis/configure_docker.sh #upgrading docker
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
script:
- while sleep 9m; do echo "=====[ $SECONDS seconds, build-docker still building... ]====="; done &
- DOCKER_BUILDKIT=1 docker build . -f docker/debian-ncp/Dockerfile -t ownyourbits/debian-ncp-armhf:latest --pull --build-arg arch=armhf --build-arg arch_qemu=arm > output
- sed -i "/innodb_file_format=barracuda/a open_files_limit=65536" lamp.sh
- tail -f output &
- DOCKER_BUILDKIT=1 docker build . -f docker/lamp/Dockerfile -t ownyourbits/lamp-armhf:latest --build-arg arch=armhf > output
- sed -i '/open_files_limit=65536/d' lamp.sh
- docker save --output docker_cached/debian-ncp-armhf.tar ownyourbits/debian-ncp-armhf:latest
- docker save --output docker_cached/lamp-armhf.tar ownyourbits/lamp-armhf:latest
-
### arm64 Docker images
env:
CACHE_NAME=ARM64
install:
- sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static
- ./.travis/configure_docker.sh #upgrading docker
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
script:
- while sleep 9m; do echo "=====[ $SECONDS seconds, build-docker still building... ]====="; done &
- DOCKER_BUILDKIT=1 docker build . -f docker/debian-ncp/Dockerfile -t ownyourbits/debian-ncp-arm64v8:latest --build-arg arch=arm64v8 --build-arg arch_qemu=aarch64 > output
- sed -i "/innodb_file_format=barracuda/a open_files_limit=65536" lamp.sh
- tail -f output &
- DOCKER_BUILDKIT=1 docker build . -f docker/lamp/Dockerfile -t ownyourbits/lamp-arm64v8:latest --build-arg arch=arm64v8 > output
- sed -i '/open_files_limit=65536/d' lamp.sh
- docker save --output docker_cached/debian-ncp-arm64v8.tar ownyourbits/debian-ncp-arm64v8:latest
- docker save --output docker_cached/lamp-arm64v8.tar ownyourbits/lamp-arm64v8:latest
- stage: building_part2
# Arms images usually take some time to get built alltogether so we split their building in 2 stages
### armhf Docker images
env:
CACHE_NAME=ARMHF
install:
- sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static
- ./.travis/configure_docker.sh #upgrading docker
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
before_script:
- docker load --input docker_cached/lamp-armhf.tar
script:
- while sleep 9m; do echo "=====[ $SECONDS seconds, build-docker still building... ]====="; done &
- DOCKER_BUILDKIT=1 docker build . -f docker/nextcloud/Dockerfile -t ownyourbits/nextcloud-armhf:latest --build-arg arch=armhf > output
- DOCKER_BUILDKIT=1 docker build . -f docker/nextcloudpi/Dockerfile -t ownyourbits/nextcloudpi-armhf:latest --build-arg arch=armhf > output
- docker save --output docker_cached/nextcloud-armhf.tar ownyourbits/nextcloud-armhf:latest
- docker save --output docker_cached/nextcloudpi-armhf.tar ownyourbits/nextcloudpi-armhf:latest
-
### arm64v8 Docker images
env:
CACHE_NAME=ARM64
install:
- sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static
- ./.travis/configure_docker.sh #upgrading docker
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
before_script:
- docker load --input docker_cached/lamp-arm64v8.tar
script:
- while sleep 9m; do echo "=====[ $SECONDS seconds, build-docker still building... ]====="; done &
- DOCKER_BUILDKIT=1 docker build . -f docker/nextcloud/Dockerfile -t ownyourbits/nextcloud-arm64v8:latest --build-arg arch=arm64v8 > output
- DOCKER_BUILDKIT=1 docker build . -f docker/nextcloudpi/Dockerfile -t ownyourbits/nextcloudpi-arm64v8:latest --build-arg arch=arm64v8 > output
- docker save --output docker_cached/nextcloud-arm64v8.tar ownyourbits/nextcloud-arm64v8:latest
- docker save --output docker_cached/nextcloudpi-arm64v8.tar ownyourbits/nextcloudpi-arm64v8:latest
- stage: testing
### x86 Docker images
env:
CACHE_NAME=X86
install:
- ./.travis/configure_docker.sh
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
- export MOZ_HEADLESS=1
- sudo apt-get install python3-pip
- sudo python3 -m pip install selenium
- wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
- tar -xvzf geckodriver*
- chmod +x geckodriver
- export PATH=$PATH:$PWD
before_script:
- docker load --input docker_cached/nextcloudpi-amd64.tar
- IP=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}')
- docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v ncdata:/data --name nextcloudpi ownyourbits/nextcloudpi-amd64:latest ${IP}
script:
- sleep 60
- ./tests/activation_tests.py ${IP}
- sleep 60
- ./tests/nextcloud_tests.py ${IP}
- sleep 5
- ./tests/system_tests.py ncp@${IP}
-
### armhf Docker images
env:
CACHE_NAME=ARMHF
install:
- sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static
- ./.travis/configure_docker.sh
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
- export MOZ_HEADLESS=1
- sudo apt-get install python3-pip
- sudo python3 -m pip install selenium
- wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
- tar -xvzf geckodriver*
- chmod +x geckodriver
- export PATH=$PATH:$PWD
before_script:
- docker load --input docker_cached/nextcloudpi-armhf.tar
- IP=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}')
- docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v ncdata:/data --name nextcloudpi ownyourbits/nextcloudpi-armhf:latest ${IP}
script:
- sleep 60
- ./tests/activation_tests.py ${IP}
- sleep 60
- ./tests/nextcloud_tests.py ${IP}
- sleep 5
- ./tests/system_tests.py ncp@${IP}
-
### arm64 Docker images
env:
CACHE_NAME=ARM64
install:
- sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static
- ./.travis/configure_docker.sh
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
- export MOZ_HEADLESS=1
- sudo apt-get install python3-pip
- sudo python3 -m pip install selenium
- wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
- tar -xvzf geckodriver*
- chmod +x geckodriver
- export PATH=$PATH:$PWD
before_script:
- docker load --input docker_cached/nextcloudpi-arm64v8.tar
- IP=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}')
- docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v ncdata:/data --name nextcloudpi ownyourbits/nextcloudpi-arm64v8:latest ${IP}
script:
- sleep 60
- ./tests/activation_tests.py ${IP}
- sleep 60
- ./tests/nextcloud_tests.py ${IP}
- sleep 5
- ./tests/system_tests.py ncp@${IP}
- stage: pushing_images
### x86 Docker images
env:
CACHE_NAME=X86
install:
- ./.travis/configure_docker.sh
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
before_script:
- docker load --input docker_cached/debian-ncp-amd64.tar
- docker load --input docker_cached/lamp-amd64.tar
- docker load --input docker_cached/nextcloud-amd64.tar
- docker load --input docker_cached/nextcloudpi-amd64.tar
- version=$(git describe --tags --always)
- version=${version%-*-*}
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker tag ownyourbits/debian-ncp-amd64:latest $DOCKER_USERNAME/debian-ncp-x86:"${version}"
- docker tag ownyourbits/lamp-amd64:latest $DOCKER_USERNAME/lamp-x86:"${version}"
- docker tag ownyourbits/nextcloud-amd64:latest $DOCKER_USERNAME/nextcloud-x86:"${version}"
- docker tag ownyourbits/nextcloudpi-amd64:latest $DOCKER_USERNAME/nextcloudpi-x86:"${version}"
- docker push $DOCKER_USERNAME/debian-ncp-x86:"${version}"
- docker push $DOCKER_USERNAME/lamp-x86:"${version}"
- docker push $DOCKER_USERNAME/nextcloud-x86:"${version}"
- docker push $DOCKER_USERNAME/nextcloudpi-x86:"${version}"
-
### armhf Docker images
env:
CACHE_NAME=ARMHF
install:
- ./.travis/configure_docker.sh
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
before_script:
- docker load --input docker_cached/debian-ncp-armhf.tar
- docker load --input docker_cached/lamp-armhf.tar
- docker load --input docker_cached/nextcloud-armhf.tar
- docker load --input docker_cached/nextcloudpi-armhf.tar
- version=$(git describe --tags --always)
- version=${version%-*-*}
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker tag ownyourbits/debian-ncp-armhf:latest $DOCKER_USERNAME/debian-ncp-armhf:"${version}"
- docker tag ownyourbits/lamp-armhf:latest $DOCKER_USERNAME/lamp-armhf:"${version}"
- docker tag ownyourbits/nextcloud-armhf:latest $DOCKER_USERNAME/nextcloud-armhf:"${version}"
- docker tag ownyourbits/nextcloudpi-armhf:latest $DOCKER_USERNAME/nextcloudpi-armhf:"${version}"
- docker push $DOCKER_USERNAME/debian-ncp-armhf:"${version}"
- docker push $DOCKER_USERNAME/lamp-armhf:"${version}"
- docker push $DOCKER_USERNAME/nextcloud-armhf:"${version}"
- docker push $DOCKER_USERNAME/nextcloudpi-armhf:"${version}"
-
### arm64v8 Docker images
env:
CACHE_NAME=ARM64
install:
- ./.travis/configure_docker.sh
- export DOCKER_CLI_EXPERIMENTAL=enabled #enable experimental features
before_script:
- docker load --input docker_cached/debian-ncp-arm64v8.tar
- docker load --input docker_cached/lamp-arm64v8.tar
- docker load --input docker_cached/nextcloud-arm64v8.tar
- docker load --input docker_cached/nextcloudpi-arm64v8.tar
- version=$(git describe --tags --always)
- version=${version%-*-*}
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker tag ownyourbits/debian-ncp-arm64v8:latest $DOCKER_USERNAME/debian-ncp-arm64:"${version}"
- docker tag ownyourbits/lamp-arm64v8:latest $DOCKER_USERNAME/lamp-arm64:"${version}"
- docker tag ownyourbits/nextcloud-arm64v8:latest $DOCKER_USERNAME/nextcloud-arm64:"${version}"
- docker tag ownyourbits/nextcloudpi-arm64v8:latest $DOCKER_USERNAME/nextcloudpi-arm64:"${version}"
- docker push $DOCKER_USERNAME/debian-ncp-arm64:"${version}"
- docker push $DOCKER_USERNAME/lamp-arm64:"${version}"
- docker push $DOCKER_USERNAME/nextcloud-arm64:"${version}"
- docker push $DOCKER_USERNAME/nextcloudpi-arm64:"${version}"
- stage: pushing_manifest
before_script:
- docker pull $DOCKER_USERNAME/nextcloudpi-x86:latest
- docker pull $DOCKER_USERNAME/nextcloudpi-armhf:latest
- docker pull $DOCKER_USERNAME/nextcloudpi-arm64:latest
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
# Manifest
- docker manifest create --amend $DOCKER_USERNAME/nextcloudpi $DOCKER_USERNAME/nextcloudpi-x86 $DOCKER_USERNAME/nextcloudpi-armhf $DOCKER_USERNAME/nextcloudpi-arm64
- docker manifest annotate $DOCKER_USERNAME/nextcloudpi $DOCKER_USERNAME/nextcloudpi-x86 --os linux --arch amd64
- docker manifest annotate $DOCKER_USERNAME/nextcloudpi $DOCKER_USERNAME/nextcloudpi-armhf --os linux --arch arm
- docker manifest annotate $DOCKER_USERNAME/nextcloudpi $DOCKER_USERNAME/nextcloudpi-arm64 --os linux --arch arm64v8
notifications:
email: false