-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (36 loc) · 1.13 KB
/
Makefile
File metadata and controls
52 lines (36 loc) · 1.13 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
.SILENT:
run:
go run cmd/server/run.go -config ./config.json
run_for_test:
go run cmd/server/run.go -config ./config_test.json
gofmt:
gofumpt -l -w .
# To fix permissions issue, run: sudo chown -R $(whoami) .db-data/
lint:
golangci-lint --config ./ci/.golangci-lint.yml run
.PHONY: test
test:
go test ./... -cover
SHELL := /bin/bash
docker_up:
source .env && docker compose -f docker-compose.yml up -d
docker_down:
docker compose -f docker-compose.yml down
# make scaffold model=<table_name>
scaffold:
go run ./cmd/scaffold/run.go -config ./config.json -table $(table)
migrate:
go run ./cmd/migrate/migrate.go -action up
# Run migrations for test database.
migrate_test:
go run ./cmd/migrate/migrate.go -action up -config config_test.json
## Container stuff ##
build_container:
docker rm dhapi-container; docker run -it --name dhapi-container dhapi /bin/bash
conn_container:
docker run -it --name dhapi-container dhapi /bin/bash
## Build test container
build_test_container:
docker build -t api-test-image -f Dockerfile_test .
run_test_container:
docker run --rm --name app-container --network mynetwork -p 8088:8088 api-test-image