-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.justfile
59 lines (46 loc) · 1.76 KB
/
.justfile
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
set dotenv-load
docker_php_exec := "docker compose exec -it php"
composer := docker_php_exec + " composer "
up:
docker compose pull
docker compose up --detach --remove-orphans --build
# update source files + docker compose down+up
update: && tests
git pull
docker compose down
docker compose up -d --build
{{composer}} install
# open a fish shell on the container
fish:
{{docker_php_exec}} fish
tests format='--testdox':
{{docker_php_exec}} php vendor/bin/phpunit {{format}}
#tests_xdebug:
tests_xdebug:
{{docker_php_exec}} env XDEBUG_MODE=debug XDEBUG_SESSION=1 XDEBUG_CONFIG="client_host=host.docker.internal client_port=9003" PHP_IDE_CONFIG="serverName=mydocker" php vendor/bin/phpunit
tests_watch:
#!/usr/bin/env sh
if ! command -v entr >/dev/null 2>&1; then
echo "Error: entr is not installed. Please install it first."
exit 1
fi
find src -name \*\.php | entr -n sh -c 'docker compose exec -T -u dev --env XDEBUG_MODE=debug --env XDEBUG_SESSION=1 --env XDEBUG_CONFIG="client_host=host.docker.internal client_port=9003" --env PHP_IDE_CONFIG="serverName=mydocker" php vendor/bin/phpunit'
run_xdebug:
{{docker_php_exec}} env XDEBUG_MODE=debug XDEBUG_SESSION=1 XDEBUG_CONFIG="client_host=host.docker.internal client_port=9003" PHP_IDE_CONFIG="serverName=mydocker" php index.php
# interactive php shell
psysh:
{{docker_php_exec}} psysh
phpstan:
{{docker_php_exec}} phpstan analyse src --level max
cs-fix:
{{docker_php_exec}} php-cs-fixer fix src
rector:
{{docker_php_exec}} vendor/bin/rector
# csfix + rector + phpstan + phpunit
lint: cs-fix rector phpstan tests
# firt run docker compose up + composer install + open browser
[private]
init:
docker compose down
just up
{{composer}} install