-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (45 loc) · 1.2 KB
/
Makefile
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
POSTGRES_CONTAINER?=icy_backend_local
POSTGRES_TEST_CONTAINER?=icy_backend_local_test
remove-infras:
docker compose down --remove-orphans --volumes
shell:
@if ! command -v devbox >/dev/null 2>&1; then curl -fsSL https://get.jetpack.io/devbox | bash; fi
@devbox install
@devbox shell
# Initialize the database and start the services
init:
@ make stop || true
@if [ -n "$$(ls -A ./data/dev 2>/dev/null)" ] || [ -n "$$(ls -A ./data/test 2>/dev/null)" ]; then \
echo "Error: ./data/dev or ./data/test is not empty. Please run 'make clean' first."; \
exit 1; \
fi
devbox run init-db
@devbox services start
@devbox services ls
# Clean the database
clean:
@ make stop || true
devbox run clean-db
# Reset the database and start the services
reset:
@ make stop || true
@ make clean
devbox run init-db
@devbox services start
@devbox services ls
# Start the services including the database
start:
@devbox services start
@devbox services ls
# Stop the services including the database
stop:
@devbox services stop
# Run the server
dev:
go run ./cmd/server/main.go
gen-swagger:
swag init --parseDependency -g ./cmd/server/main.go
migrate-up:
devbox run migrate-up
migrate-down:
devbox run migrate-down