-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
77 lines (58 loc) · 2.03 KB
/
Copy pathjustfile
File metadata and controls
77 lines (58 loc) · 2.03 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
# `cd .` is because it sometimes solves https://github.com/docker/compose/issues/7899
docker := "cd . && DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) docker compose"
orange := '\033[0;33m'
nocolor := '\033[0m'
console:
{{ docker }} run php bash
alias sh := console
alias release := build
build:
{{ docker }} up -d --remove-orphans
{{ docker }} run php composer build # see composer.json -> "scripts" section
just test
# Rebuild docker image (or all of them) to reflect configuration (e.g. Dockerfile) changes.
rebuild:
{{ docker }} up -d --build --force-recreate --no-deps --remove-orphans
# Run tests. Accepts `p` parameter as filter + repeat parameter: `just test p=fileapitest repeat=1`
test p="" repeat="1":
#!/usr/bin/env bash
if [ -z "{{ p }}" ]; then
{{ docker }} run php ./vendor/bin/pest
else
for i in $(seq 1 {{ repeat }}); do
echo "{{ orange }}Repetition $i of {{ repeat }}{{ nocolor }}"
echo "{{ docker }} run php ./vendor/bin/pest --filter {{ p }}"
{{ docker }} run php ./vendor/bin/pest --filter {{ p }}
done
fi
up:
{{ docker }} up -d
restart:
-{{ docker }} down
{{ docker }} up -d
# Nuclear option to force-remove all docker images, volumes and containers
nuke-docker:
-{{ docker }} down --volumes
-{{ docker }} rm --force --stop --volumes
-docker kill $(docker ps -q)
-docker volume rm $(docker volume ls -q)
-docker rmi --force $(docker images -a -q)
# Stop docker and delete its volumes
down-for-good:
-{{ docker }} rm --force --stop --volumes
-{{ docker }} down --volumes
composer-update:
@{{ docker }} up -d php
{{ docker }} exec php composer update
composer-install:
@{{ docker }} up -d php
{{ docker }} exec php composer install
alias cu := composer-update
alias ci := composer-install
play:
just up
{{ docker }} exec php php /var/www/playground.php
serve:
just up
@echo "go to ----> http://localhost:18181 <-----"
{{ docker }} exec php php -S 0.0.0.0:18181 playground.php