-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
.drone.yml
343 lines (324 loc) · 9.66 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
kind: pipeline
name: default
steps:
- name: composer
image: mirror.gcr.io/knik/php:7.3-fpm-stretch
commands:
- apt -y update && apt install -y git
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install --no-ansi
- touch composer_installed
- name: tests-php-7.3
image: mirror.gcr.io/knik/php:7.3-fpm-stretch
environment:
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
commands:
- cp .env.example .env
- php artisan migrate:fresh --seed
- php artisan route:list
- vendor/bin/phpunit --verbose
- rm -rf storage/app/certs
- rm -rf storage/framework/cache/data/*
- rm -rf storage/framework/sessions/*
- rm -rf storage/framework/views/*
- rm -rf storage/debugbar/*
- rm -rf storage/logs/*
- rm .env
- name: tests-php-7.4
image: mirror.gcr.io/knik/php:7.4-fpm-alpine
environment:
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
commands:
- cp .env.example .env
- php artisan migrate:fresh --seed
- vendor/bin/phpunit --verbose
- rm -rf storage/app/certs
- rm -rf storage/framework/cache/data/*
- rm -rf storage/framework/sessions/*
- rm -rf storage/framework/views/*
- rm -rf storage/debugbar/*
- rm -rf storage/logs/*
- rm .env
- name: tests-php-8.0
image: mirror.gcr.io/knik/php:8.0-fpm-alpine
environment:
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
commands:
- cp .env.example .env
- php artisan migrate:fresh --seed
- vendor/bin/phpunit --verbose
- rm -rf storage/app/certs
- rm -rf storage/framework/cache/data/*
- rm -rf storage/framework/sessions/*
- rm -rf storage/framework/views/*
- rm -rf storage/debugbar/*
- rm -rf storage/logs/*
- rm .env
- name: tests-php-8.1
image: mirror.gcr.io/knik/php:8.1-fpm-alpine
environment:
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
commands:
- cp .env.example .env
- php artisan migrate:fresh --seed
- vendor/bin/phpunit --verbose
- rm -rf storage/app/certs
- rm -rf storage/framework/cache/data/*
- rm -rf storage/framework/sessions/*
- rm -rf storage/framework/views/*
- rm -rf storage/debugbar/*
- rm -rf storage/logs/*
- rm .env
- name: tests-php-8.2
image: mirror.gcr.io/knik/php:8.2-fpm-alpine
failure: ignore
environment:
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
commands:
- cp .env.example .env
- php artisan migrate:fresh --seed
- vendor/bin/phpunit --verbose
- rm -rf storage/app/certs
- rm -rf storage/framework/cache/data/*
- rm -rf storage/framework/sessions/*
- rm -rf storage/framework/views/*
- rm -rf storage/debugbar/*
- rm -rf storage/logs/*
- rm .env
- name: npm
image: mirror.gcr.io/node:20
commands:
- node --version
- npm install
- npm run prod
- name: browser-tests
image: mirror.gcr.io/knik/php:7.3-fpm-buster
environment:
SELENIUM_URL: http://selenium:4444/wd/hub
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
APP_DEBUG: true
APP_ENV: local
APP_ALLOW_REGISTRATION: true
APP_TIMEZONE: UTC
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
APP_URL: http://webserver
DAEMON_SETUP_TOKEN: test_auto_setup_token
CACHE_DRIVER: null
commands:
- ./artisan migrate:fresh --seed
- ./artisan dusk --debug --exclude-group daemon,userServers
- ./artisan migrate:fresh --seed
- ./artisan dusk --debug --group daemon
- rm -rf storage/app/certs
- rm -rf storage/framework/cache/data/*
- rm -rf storage/framework/sessions/*
- rm -rf storage/framework/views/*
- rm -rf storage/debugbar/*
- rm -rf storage/logs/*
shm_size: 2000000000
volumes:
- name: daemon_logs
path: /var/log/gameap-daemon
- name: composer-production
image: knik/php:7.3-fpm-stretch
commands:
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install --no-dev --optimize-autoloader --no-ansi
- rm composer_installed
when:
branch:
- master
- name: archive
image: mirror.gcr.io/debian:buster
commands:
- apt update && apt -y install rsync
- mkdir gameap
- rsync -rl --exclude=/gameap --exclude=/node_modules --exclude=/storage/app/certs ./ gameap/
- tar czf "/publish/gameap-3.2.tar.gz" "gameap"
volumes:
- name: publish
path: /publish
when:
branch:
- master
- aws-publish-test
- name: archive-shared
image: mirror.gcr.io/knik/php:8.2-fpm-alpine
environment:
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
APP_DEBUG: true
APP_ENV: local
APP_ALLOW_REGISTRATION: true
APP_TIMEZONE: UTC
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
APP_URL: http://webserver
commands:
- apk add mariadb-client zip unzip rsync
- rm -rf storage/app/certs/*
- rm -rf storage/framework/cache/data/*
- rm -rf storage/framework/sessions/*
- rm -rf storage/framework/views/*
- rm -rf storage/debugbar/*
- rm -rf storage/logs/*
- rm .env || true
- mkdir -p gameap-shared/upload
- php artisan migrate:fresh --seed --force
- mysqldump -h db -u homestead -p --password=secret homestead > gameap.sql
- curl -O http://packages.gameap.com/gameap/shared-build-artifacts.zip
- rsync -rl --exclude=/gameap --exclude=/node_modules --exclude=/storage/app/certs --exclude=/publish --exclude=/shared-build-artifacts.zip ./ gameap-shared/upload/
- unzip -o shared-build-artifacts.zip -d gameap-shared
- cd gameap-shared
&& mv upload/gameap.sql gameap.sql
&& zip -r "/publish/gameap-3.2-shared.zip" ./
volumes:
- name: publish
path: /publish
when:
branch:
- master
- aws-publish-test
- name: publish
image: mirror.gcr.io/cschlosser/drone-ftps
environment:
FTP_USERNAME:
from_secret: ftp_username
FTP_PASSWORD:
from_secret: ftp_password
settings:
hostname: packages.gameap.ru:21
secrets: [ ftp_username, ftp_password ]
secure: false
src_dir: /publish
dest_dir: /gameap
chmod: false
include:
- ^.*tar\.gz$
- ^.*zip$
volumes:
- name: publish
path: /drone/src/publish
when:
branch:
- master
- aws-publish-test
- name: publish-sdn
image: mirror.gcr.io/plugins/s3
settings:
bucket: gameap
region: eu-central-1
access_key:
from_secret: aws_access_key_id
secret_key:
from_secret: aws_secret_access_key
source: /publish/*
strip_prefix: /publish
target: /gameap
volumes:
- name: publish
path: /publish
when:
branch:
- master
- aws-publish-test
- name: artifacts
image: mirror.gcr.io/knik/drone-s3-plugin
failure: ignore
settings:
endpoint:
from_secret: s3_endpoint
bucket: gameap-drone-tests
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source:
- tests/Browser/screenshots/*
- tests/Browser/console/*
- storage/logs/*
- /var/log/gameap-daemon/*
target: /${DRONE_BRANCH}/${DRONE_BUILD_NUMBER}
path_style: true
volumes:
- name: daemon_logs
path: /var/log/gameap-daemon
when:
status:
- failure
services:
- name: db
image: mirror.gcr.io/mysql:5.6
environment:
MYSQL_ROOT_PASSWORD: userpass
MYSQL_DATABASE: homestead
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
- name: webserver
image: mirror.gcr.io/knik/php:7.4-cli-alpine
environment:
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
APP_DEBUG: true
APP_ENV: local
APP_ALLOW_REGISTRATION: true
APP_TIMEZONE: UTC
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
CACHE_DRIVER: null
commands:
- while [[ ! -f composer_installed ]]; do sleep 2; echo "Waiting composer..."; done;
- ./artisan serve --host=webserver --port=80
- name: selenium
image: mirror.gcr.io/selenium/standalone-chrome:4.1.0
shm_size: 2000000000
environment:
HUB_PORT: 4444
SCREEN_WIDTH: 1280
SCREEN_HEIGHT: 800
volumes:
- name: daemon_logs
temp: {}
- name: publish
temp: {}