-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yaml
108 lines (104 loc) · 3.44 KB
/
.drone.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
---
kind: 'pipeline'
name: 'tests'
type: 'docker'
steps:
- name: 'Install the PHP dependencies'
image: 'git.kalehmann.de/karsten/wetterobservatoriumweb/php'
commands:
- 'composer install'
- name: 'Static analysis of PHP code'
image: 'git.kalehmann.de/karsten/wetterobservatoriumweb/php'
commands:
- >-
/usr/bin/env php -dmemory_limit=-1 vendor/bin/phpstan
--level=max analyze config.php public/ src/ tests/
depends_on:
- 'Install the PHP dependencies'
- name: 'Style check of PHP code'
image: 'git.kalehmann.de/karsten/wetterobservatoriumweb/php'
commands:
- >-
/usr/bin/env php vendor/bin/phpcs
--standard=PSR12 config.php public/api.php src/ tests/
depends_on:
- 'Install the PHP dependencies'
- name: 'PHP unit tests'
image: 'git.kalehmann.de/karsten/wetterobservatoriumweb/php'
commands:
- '/usr/bin/env php vendor/bin/phpunit tests/'
depends_on:
- 'Install the PHP dependencies'
image_pull_secrets:
- 'dockerconfigjson'
---
kind: 'pipeline'
name: 'deployment'
type: 'docker'
depends_on:
- 'tests'
steps:
- name: 'Install the Node dependencies'
image: 'git.kalehmann.de/karsten/wetterobservatoriumweb/node'
commands:
- 'yarn install'
- name: 'Install the PHP dependencies'
image: 'git.kalehmann.de/karsten/wetterobservatoriumweb/php'
commands:
- 'composer install --no-dev --classmap-authoritative'
- name: 'Run webpack'
image: 'git.kalehmann.de/karsten/wetterobservatoriumweb/node'
commands:
- 'yarn run webpack --mode=production'
depends_on:
- 'Install the Node dependencies'
- name: 'Deploy the website'
image: 'git.kalehmann.de/infrastructure/dockerimages/lftp'
commands:
- 'echo "$${ENV_FILE}" | tr " " "\n" > .env'
- 'lftp -e "
set ftp:ssl-force true;
set ssl:verify-certificate yes;
open -u $${USER},$${PASSWORD} $${SERVER};
mirror
--delete
--exclude=^.dockerignore
--exclude=^.drone.yaml
--exclude=^.editorconfig
--exclude=^.git
--exclude=^.pnp.cjs
--exclude=^.yarn
--exclude=^.yarnrc.yml
--exclude=^assets
--exclude=^data
--exclude=^doc
--exclude=^docker
--exclude=^Dockerfile
--exclude=^package.json
--exclude=^scripts
--exclude=^tests
--exclude=^webpack.config.js
--exclude=^yarn.lock
--parallel=20
--reverse
$(pwd)
public_html/alaunwetter-kalehmann-de;
exit;"'
depends_on:
- 'Install the PHP dependencies'
- 'Run webpack'
environment:
ENV_FILE:
from_secret: 'env_file'
USER:
from_secret: 'ftp_user'
PASSWORD:
from_secret: 'ftp_password'
SERVER:
from_secret: 'ftp_server'
when:
branch:
- 'master'
image_pull_secrets:
- 'dockerconfigjson'
...