-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
249 lines (219 loc) · 6.27 KB
/
Copy pathTaskfile.yml
File metadata and controls
249 lines (219 loc) · 6.27 KB
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
version: '3'
# https://taskfile.dev/usage/#env-files
dotenv: ['.env.local', '.env']
tasks:
site:install:
desc: Install site from scratch
prompt: Really (re)install site?
cmds:
- if: '[ "$TASK_USE_DDEV" = "true" ]'
cmd: |
ddev delete --omit-snapshot --yes
rm -fr .ddev/data/scorpio-db/
- task: site:update
site:update:
desc: Update site
cmds:
- if: '[ "$TASK_USE_DDEV" != "true" ]'
task: compose
vars:
TASK_ARGS: pull
- if: '[ "$TASK_USE_DDEV" = "true" ]'
cmd: ddev restart
- task: composer:install
# - task: console
# vars:
# TASK_ARGS: doctrine:migrations:migrate --no-interaction
- task: console
vars:
TASK_ARGS: cache:clear
site:open:
desc: Open the site in a browser
cmds:
- if: '[ "$TASK_USE_DDEV" != "true" ]'
cmd: open 'http://enter.local.itkdev.dk/'
- if: '[ "$TASK_USE_DDEV" = "true" ]'
cmd: ddev launch
test:
desc: Run all tests
cmds:
- task: test:unit
# - task: test:application
# - task: test:integration
test:unit: &test_task
env:
APP_ENV: test
desc: 'Run all {{.TASK | replace "test:" "" }} tests'
cmd:
task: php
vars:
TASK_ARGS: bin/phpunit tests/{{.TASK | replace "test:" "" | title }}
test:integration: *test_task
test:application: *test_task
import:
desc: 'Import a source into the broker, e.g. `task {{.TASK}} -- mtm_spatialmaps-handicap-parking`'
cmd:
task: console
vars:
TASK_ARGS: app:import
coding-standards:apply:
desc: 'Apply coding standards'
cmds:
- task: coding-standards:assets:apply
- task: coding-standards:composer:apply
- task: coding-standards:markdown:apply
- task: coding-standards:php:apply
- task: coding-standards:twig:apply
- task: coding-standards:yaml:apply
coding-standards:check:
desc: 'Apply coding standards'
cmds:
- task: coding-standards:assets:check
- task: coding-standards:composer:check
- task: coding-standards:markdown:check
- task: coding-standards:php:check
- task: coding-standards:twig:check
- task: coding-standards:yaml:check
coding-standards:assets:apply:
desc: 'Apply coding standards for assets'
cmd:
task: compose
vars:
TASK_ARGS: run --rm prettier 'assets/' --write
coding-standards:assets:check:
desc: 'Apply and check coding standards for assets'
cmds:
- task: coding-standards:assets:apply
- task: compose
vars:
TASK_ARGS: run --rm prettier 'assets/' --check
coding-standards:composer:apply:
desc: 'Apply coding standards for Composer'
cmd:
task: composer
vars:
TASK_ARGS: normalize
coding-standards:composer:check:
desc: 'Apply and check coding standards for Composer'
cmds:
- task: coding-standards:composer:apply
- task: composer
vars:
TASK_ARGS: audit
- task: composer
vars:
TASK_ARGS: normalize --dry-run
- task: composer
vars:
TASK_ARGS: validate --strict
coding-standards:markdown:apply:
desc: 'Apply coding standards for Markdown'
cmds:
- task: compose
vars:
TASK_ARGS: run --rm markdownlint '**/*.md' --fix
coding-standards:markdown:check:
desc: 'Apply and check coding standards for Markdown'
cmds:
- task: coding-standards:markdown:apply
- task: compose
vars:
TASK_ARGS: run --rm markdownlint '**/*.md'
coding-standards:php:apply:
desc: 'Apply coding standards for PHP'
cmds:
- task: php
vars:
TASK_ARGS: vendor/bin/rector
- task: php
vars:
TASK_ARGS: vendor/bin/php-cs-fixer fix
coding-standards:php:check:
desc: 'Apply and check coding standards for PHP'
cmds:
- task: coding-standards:php:apply
- task: php
vars:
TASK_ARGS: vendor/bin/rector --dry-run
- task: php
vars:
TASK_ARGS: vendor/bin/php-cs-fixer check
coding-standards:twig:apply:
desc: 'Apply coding standards for Twig'
cmds:
- task: php
vars:
TASK_ARGS: vendor/bin/twig-cs-fixer fix
coding-standards:twig:check:
desc: 'Apply and check coding standards for Twig'
cmds:
- task: coding-standards:twig:apply
- task: php
vars:
TASK_ARGS: vendor/bin/twig-cs-fixer check
coding-standards:yaml:apply:
desc: 'Apply coding standards for YAML'
cmds:
- task: compose
vars:
TASK_ARGS: run --rm prettier --parser yaml phpstan*.neon '**/*.{yml,yaml}' --write
coding-standards:yaml:check:
desc: 'Apply and check coding standards for YAML'
cmds:
- task: coding-standards:yaml:apply
- task: compose
vars:
TASK_ARGS: run --rm prettier --parser yaml phpstan*.neon '**/*.{yml,yaml}' --check
code-analysis:
desc: 'Run code analysis'
cmds:
- task: code-analysis:phpstan
- task: code-analysis:mago
code-analysis:phpstan:
desc: 'Run PHPStan'
cmds:
- task: compose
vars:
TASK_ARGS: run --rm --no-deps phpfpm composer install --no-scripts
- task: compose
vars:
TASK_ARGS: run --rm --no-deps phpfpm vendor/bin/phpstan
compose:
internal: true
cmd: 'docker compose {{.TASK_ARGS}} {{.CLI_ARGS}}'
composer:
internal: true
cmd:
task: compose
vars:
TASK_ARGS: run --rm --no-deps phpfpm composer {{.TASK_ARGS}}
composer:install:
internal: true
cmds:
- if: '[ "$APP_ENV" != "prod" ]'
task: composer
vars:
TASK_ARGS: install
- if: '[ "$APP_ENV" = "prod" ]'
task: composer
vars:
TASK_ARGS: install --no-dev --classmap-authoritative
console:
internal: true
cmd:
task: php
vars:
TASK_ARGS: bin/console {{.TASK_ARGS}}
php:
internal: true
cmds:
- if: '[ "$TASK_USE_DDEV" != "true" ]'
task: compose
vars:
TASK_ARGS: exec phpfpm php {{.TASK_ARGS}}
- if: '[ "$TASK_USE_DDEV" = "true" ]'
cmd: ddev php {{.TASK_ARGS}}
default:
cmds:
- task --list-all
silent: true