-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathTaskfile.yml
176 lines (149 loc) · 4.11 KB
/
Taskfile.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
version: '2'
vars:
UID:
sh: id -u
GID:
sh: id -g
PREFIX: docker-compose exec app
HOST_IP:
sh: ip route get 1.2.3.4 | awk '{print $7}' | tr -d '\n'
env:
CURRENT_UID: "{{.UID}}:{{.GID}}"
HOST_IP: "{{.HOST_IP}}"
tasks:
build:
desc: Build Dev Dockerfile
deps: [stop]
cmds:
- docker-compose build
sources:
- provisioning/DockerfileDev
method: checksum
vendor:
desc: Install composer deps
deps: [start]
cmds:
- "{{.PREFIX}} composer install --ignore-platform-reqs"
sources:
- composer.json
generates:
- vendor
- composer.lock
method: checksum
start:
desc: Start the docker-compose stack
cmds:
- docker-compose up -d
status:
- test -n "$(docker-compose top)"
env:
stop:
desc: Stop the docker-compose stack
cmds:
- docker-compose stop
status:
- test -z "$(docker-compose top)"
logs:
desc: Display syslog
deps: [start]
cmds:
- docker-compose logs -f
migrate:
desc: Reset the database and run the seed
deps: [start]
cmds:
- "{{.PREFIX}} php artisan migrate && redis-cli flushall"
dbreset:
desc: Reset the database and run the seed
deps: [start]
cmds:
- "{{.PREFIX}} php artisan migrate:fresh --seed && redis-cli flushall"
sh:
desc: Get a shell from the main container
deps: [start]
cmds:
- "{{.PREFIX}} bash"
generate-swagger:
desc: Generate OpenAPI (Swagger) spec YAML
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'cd public/swagger ; php -q doc.php > swagger.yaml'"
phpcs:
desc: Run PHP Code Sniffer
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which phpcs` app'"
phpcs-fix:
desc: Run PHP Code Sniffer Fixer
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which php-cs-fixer` fix app'"
phpmd:
desc: Run PHP Mess Detector
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which phpmd` ./app html cleancode,codesize,controversial,design,naming,unusedcode --ignore-violations-on-exit --reportfile ./docs/phpmd-report.html'"
phpmnd:
desc: Run PHP Magic Number Detector
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which phpmnd` app'"
dephpend:
desc: Run DePHPend
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which dephpend` text app'"
phploc:
desc: Run PhpLoc
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which phploc` app'"
phpcpd:
desc: Run Php Copy/Paste Detector
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which phpcpd` --fuzzy app'"
churn:
desc: Run Php Churn
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which churn` run app -c churn.yml'"
phpcf:
desc: Run Php Code Fixer
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which phpcf` -t 7.4 app'"
phpmetrics:
desc: Run Php Metrics
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which phpmetrics` --report-html=./docs/phpmetrics app'"
security-checker:
desc: Run SensioLabs PHP Security Checker
deps: [start]
cmds:
- "{{.PREFIX}} sh -c 'php -d memory_limit=2G `which security-checker` security:check composer.lock'"
phpstan:
desc: Run PHPSTan static analysis
deps: [start]
cmds:
- "{{.PREFIX}} ./vendor/bin/phpstan analyse --memory-limit=2G"
phpinsights:
desc: Run PHP Insights code quality analysis
deps: [start]
cmds:
- "{{.PREFIX}} php -d memory_limit=2G artisan insights"
phpinsights-fix:
desc: Run PHP Insights code quality analysis and fix errors.
deps: [start]
cmds:
- "{{.PREFIX}} php -d memory_limit=2G artisan insights --fix"
test:
desc: Run phpunit
deps: [start]
cmds:
- "{{.PREFIX}} php vendor/bin/phpunit --configuration phpunit.xml -v --testdox --coverage-html ./docs/coverage/"
default:
desc: Default task, starts in foreground
cmds:
- docker-compose up