-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·95 lines (68 loc) · 1.84 KB
/
run
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
#!/usr/bin/bash
set -o errexit
set -o pipefail
function ps {
docker compose ps
}
function up {
docker compose up "${@}"
}
function down {
docker compose down "${@}"
}
function composer {
docker run --rm --interactive \
-e COMPOSER_CACHE_DIR="/app/.cache/composer" \
-u "$(id -u):$(id -g)" -v "$(pwd):/app" \
-w /app composer:2.7.2 composer "${@}"
}
function nginx:check {
docker compose exec web nginx -t
}
function nginx:status {
docker compose exec web service nginx status
}
function nginx:reload {
docker compose exec web nginx -s reload
}
function test {
TEST_PATH="${@:-tests}"
docker compose run --rm php ./vendor/bin/phpunit --color ${TEST_PATH}
}
function phpcs {
TEST_PATH="${@:-.}"
docker compose run --rm php ./vendor/bin/phpcs ${TEST_PATH}
}
function phpcbf {
TEST_PATH="${@:-.}"
docker compose run --rm php ./vendor/bin/phpcbf ${TEST_PATH}
}
function php:console {
docker compose exec php php -a
}
function phpstan {
TEST_PATH="${@:-}"
docker compose run --rm php ./vendor/bin/phpstan ${TEST_PATH}
}
function dumpAutoloadCS(){
docker compose run --rm composer dump-autoloadcs
}
function dumpAutoload(){
docker compose run --rm composer dump-autoload
}
function git:clean:branchs {
git branch | grep -v '\*\|master\|main\|develop\|production' | xargs -n 1 git branch -D
}
function db:console() {
docker exec -it db sh -c "MYSQL_PWD=${DB_PASSWORD} mysql -u ${DB_USER} ${DB_DATABASE}"
}
source .env
function db:reset(){
docker cp database/schema.sql db:/tmp/
docker exec db sh -c "MYSQL_PWD='${DB_PASSWORD}' mysql -u'${DB_USER}' '${DB_DATABASE}' --default-character-set=utf8mb4 < /tmp/schema.sql"
}
function db:populate(){
docker compose exec php php database/Populate/populate.php
}
TIMEFORMAT=$'\nTask completed in %3lR'
time ${@}