forked from joomla/joomla-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
443 lines (402 loc) · 12.6 KB
/
.drone.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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
---
kind: pipeline
name: default
clone:
steps:
- name: setup
image: joomlaprojects/docker-images:php8.1
volumes:
- name: certificates
path: /certificates
commands:
- cp -v tests/Codeception/_data/certs/* /certificates/
- name: composer
image: joomlaprojects/docker-images:php8.1
volumes:
- name: composer-cache
path: /tmp/composer-cache
commands:
- composer validate --no-check-all --strict
- composer install --no-progress --ignore-platform-reqs
- name: phpcs
image: joomlaprojects/docker-images:php8.1
depends_on: [ composer ]
commands:
- echo $(date)
- ./libraries/vendor/bin/phpcs --extensions=php -p --standard=ruleset.xml .
- echo $(date)
- name: phan
image: joomlaprojects/docker-images:php7.4-ast
depends_on: [ phpcs ]
failure: ignore
commands:
- ./libraries/vendor/bin/phan
- name: npm
image: node:16-bullseye-slim
depends_on: [ phpcs ]
volumes:
- name: npm-cache
path: /tmp/npm-cache
environment:
npm_config_cache: /tmp/npm-cache
commands:
- npm ci --unsafe-perm
- name: php81-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.1
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
- name: php81-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.1
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration
- name: php82-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration
- name: php81-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.1
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist
- name: php82-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist
- name: scss-cs
depends_on: [ npm ]
image: node:current-alpine
commands:
- npm run lint:css
- name: javascript-cs
depends_on: [ npm ]
image: node:current-alpine
commands:
- npm run lint:js
- name: prepare_system_tests
depends_on:
- npm
image: joomlaprojects/docker-images:systemtests8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
commands:
- sed -i 's/tests\\/Codeception\\/_output/\\/drone\\/src\\/tests\\/cypress\\/output/' codeception.yml
- php libraries/vendor/bin/codecept build
- npx cypress install
- npx cypress verify
- name: phpmin-api-mysql
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:systemtests8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysql mysqli mysql jos_
- name: phpmax-api-mysql
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:systemtests8.2
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
failure: ignore
commands:
- echo "This test is disabled because php max is not stable yet"
- exit 1
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpmax mysqli mysql phpmax_
- name: phpnext-api-mysql
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpnext mysqli mysql phpnext_
- name: phpmin-api-postgres
depends_on:
- phpmin-api-mysql
image: joomlaprojects/docker-images:systemtests8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgres pgsql postgres jos_
- name: phpmax-api-postgres
depends_on:
- phpmax-api-mysql
image: joomlaprojects/docker-images:systemtests8.2
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
failure: ignore
commands:
- echo "This test is disabled because php max is not stable yet"
- exit 1
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpmax pgsql postgres phpmax_
- name: phpnext-api-postgres
depends_on:
- phpnext-api-mysql
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpnext pgsql postgres phpnext_
- name: phpmin-system-mysql
depends_on:
- phpnext-api-mysql
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql mysqli mysql
- name: phpmax-system-mysql
depends_on:
- phpmin-system-mysql
image: joomlaprojects/docker-images:cypress8.2
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
failure: ignore
commands:
- echo "This test is disabled because php max is not stable yet"
- exit 1
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysqlmax mysqli mysql
- name: phpnext-system-mysql
depends_on:
- phpmax-system-mysql
image: joomlaprojects/docker-images:cypress8.2
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
failure: ignore
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysqlnext mysqli mysql
- name: phpmin-system-postgres
depends_on:
- phpnext-api-postgres
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgres pgsql postgres
- name: phpmax-system-postgres
depends_on:
- phpmin-system-postgres
image: joomlaprojects/docker-images:cypress8.2
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
failure: ignore
commands:
- echo "This test is disabled because php max is not stable yet"
- exit 1
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres
- name: phpnext-system-postgres
depends_on:
- phpmax-system-postgres
image: joomlaprojects/docker-images:cypress8.2
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
failure: ignore
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgresnext pgsql postgres
- name: artifacts-system-tests
image: cschlosser/drone-ftps
depends_on:
- phpnext-system-mysql
- phpnext-system-postgres
- phpmax-system-mysql
- phpmax-system-postgres
- phpmin-system-mysql
- phpmin-system-postgres
- phpnext-api-mysql
- phpnext-api-postgres
- phpmax-api-mysql
- phpmax-api-postgres
- phpmin-api-mysql
- phpmin-api-postgres
environment:
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
PLUGIN_HOSTNAME: ci.joomla.org:21
PLUGIN_SRC_DIR: /tests/cypress/output/
PLUGIN_DEST_DIR: /artifacts
PLUGIN_SECURE: false
PLUGIN_EXCLUDE: ^\.git/$
GITHUB_TOKEN:
from_secret: github_token
commands:
- export PLUGIN_DEST_DIR=$PLUGIN_DEST_DIR/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- echo https://ci.joomla.org$PLUGIN_DEST_DIR
- /bin/upload.sh
- 'curl -X POST "https://api.github.com/repos/$DRONE_REPO/statuses/$DRONE_COMMIT" -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" -d "{\"state\":\"failure\", \"context\": \"Artifacts from Failure\", \"description\": \"You can find artifacts from the failure of the build here:\", \"target_url\": \"https://ci.joomla.org$PLUGIN_DEST_DIR\"}" > /dev/null'
when:
status:
- failure
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
- name: cypress-cache
host:
path: /tmp/cypress-cache
- name: npm-cache
host:
path: /tmp/npm-cache
- name: certificates
host:
path: /tmp/certificates
services:
- name: mysql
image: mysql:8
command: ["--default-authentication-plugin=mysql_native_password"]
environment:
MYSQL_USER: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_DATABASE: test_joomla
- name: postgres
image: postgres:12-alpine
ports:
- 5432
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: joomla_ut
POSTGRES_DB: test_joomla
- name: openldap
image: bitnami/openldap:latest
ports:
- 1389
- 1636
volumes:
- name: certificates
path: /certificates
environment:
LDAP_ADMIN_USERNAME: admin
LDAP_ADMIN_PASSWORD: adminpassword
LDAP_USERS: customuser
LDAP_PASSWORDS: custompassword
LDAP_ENABLE_TLS: yes
LDAP_TLS_CERT_FILE: /certificates/openldap.crt
LDAP_TLS_KEY_FILE: /certificates/openldap.key
LDAP_TLS_CA_FILE: /certificates/CA.crt
BITNAMI_DEBUG: true
LDAP_CONFIG_ADMIN_ENABLED: yes
LDAP_CONFIG_ADMIN_USERNAME: admin
LDAP_CONFIG_ADMIN_PASSWORD: configpassword
---
kind: pipeline
name: package
steps:
- name: packager
image: joomlaprojects/docker-images:packager
environment:
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
FTP_HOSTNAME: ci.joomla.org
FTP_PORT: "21"
FTP_DEST_DIR: /artifacts
FTP_VERIFY: "false"
FTP_SECURE: "true"
HTTP_ROOT: "https://ci.joomla.org/artifacts"
DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
DRONE_COMMIT: DRONE_COMMIT
GITHUB_TOKEN:
from_secret: github_token
commands:
- if [ $DRONE_REPO_NAME != 'joomla-cms' ]; then echo "The packager only runs on the joomla/joomla-cms repo"; exit 0; fi
- /bin/drone_build.sh
volumes:
- name: reference
path: /reference
when:
repo:
- joomla/joomla-cms
---
kind: pipeline
name: nightly_build
steps:
- name: prepare
image: joomlaprojects/docker-images:packager
commands:
- export MINORVERSION=${DRONE_BRANCH%-*}
- composer --version
- mkdir -p transfer
- date +%s > transfer/$MINORVERSION-time.txt
- git rev-parse origin/$MINORVERSION-dev > transfer/$MINORVERSION.txt
- php build/build.php --remote=origin/$MINORVERSION-dev --exclude-gzip --exclude-bzip2
- mv build/tmp/packages/* transfer/
- name: upload
image: joomlaprojects/docker-images:packager
environment:
nightly_key:
from_secret: nightly_key
nightly_user:
from_secret: nightly_user
nightly_host:
from_secret: nightly_host
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
commands:
- export MINORVERSION=${DRONE_BRANCH%-*}
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$nightly_key" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create nightly sftp host $nightly_host user $nightly_user port 22
- rclone delete nightly:/home/devj/public_html/nightlies/ --include "Joomla_$MINORVERSION.*"
- rclone delete nightly:/home/devj/public_html/cache/com_content/
- rclone copy ./transfer/ nightly:/home/devj/public_html/nightlies/
- /bin/notify
- name: buildfailure
image: joomlaprojects/docker-images:packager
environment:
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
commands:
- /bin/notify
when:
status:
- failure
trigger:
event:
- cron
- custom
repo:
- joomla/joomla-cms
---
kind: signature
hmac: 3a3ef79114bb90dff0d69e22b7c91c03b2e87d9544d134285a1b292400dd31ba
...