-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
70 lines (55 loc) · 1.57 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
60
61
62
63
64
65
66
67
68
69
70
export UID := `id -u`
export GID := `id -g`
COMPOSE := 'docker compose -f docker/compose.yml'
COMPOSE-RUN := COMPOSE + ' run --rm'
GO-RUN := COMPOSE-RUN + ' --no-deps go'
SVELTEKIT-RUN := COMPOSE-RUN + ' sveltekit'
DB-RUN := COMPOSE-RUN + ' -T --no-deps db'
default:
just --list
# start all containers
start *args:
{{COMPOSE}} up -d {{args}}
@echo URL: http://localhost:5173
# stop all containers
stop:
{{COMPOSE}} stop
# remove all containers and unversioned changes
clean:
{{COMPOSE}} rm -vsf
git clean -fdqx -e .idea
# run just clean, then rebuild containers with pulling anew & install dependencies
rebuild: clean
{{COMPOSE}} build --pull
just install
# rebuild containers without cleaning up and pulling anew
soft-rebuild:
{{COMPOSE}} build
# install svelteApp dependencies
install:
{{SVELTEKIT-RUN}} pnpm install
# seed DB with testdata
init-db:
cat migrations/*.sql | {{DB-RUN}} mysql -uroot -psoccer -hdb zendo
# exec into a running container
exec-ti *args:
{{COMPOSE}} exec -ti {{args}}
# direct access to pnpm command inside a svelteApp container
pnpm *args:
{{SVELTEKIT-RUN}} pnpm {{args}}
# short for: docker compose -f docker/compose.yml
compose *args:
{{COMPOSE}} {{args}}
# direct access to mysql command inside a db container
mysql *args:
{{DB-RUN}} mysql {{args}}
# run eslint on sveltekit app code
eslint-sveltekit *args:
{{SVELTEKIT-RUN}} pnpm eslint {{args}}
# run go tests - don't use too often
# bc. deps are downloaded at each run
# and thus github could block you
[no-cd]
[private]
test-go *args:
{{GO-RUN}} go test ./... -v {{args}}