-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (38 loc) · 1.91 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
~.PHONY: test help
test: up-dbs test-unit
up-dbs: ## Bring up the DBs
docker compose -f docker-compose.db.yml up -d
down-dbs: ## Take down the DBs
docker compose -f docker-compose.db.yml down
test-unit: ## Run unit tests - Need DB compose up
cd src && go test ./... -v --tags=unit
#ginkgo -r -tags unit --randomizeAllSpecs --randomizeSuites --failOnPending --cover --trace --race --progress -v
# TODO: Update tags #23
test-integration: ## Run integration tests - Need DB compose up
cd src && go test ./... -v --tags=integration
#ginkgo -r -tags integration --randomizeAllSpecs --randomizeSuites --failOnPending --cover --trace --race --progress -v
test-coverage: ## Run unit tests - Need DB compose up
cd src && go test ./... -v -race -covermode=atomic -coverprofile=../coverage.out
pull:
docker compose -f docker-compose.db.yml -f docker-compose.yml pull
up: ## Bring everything up as containers
docker compose -f docker-compose.db.yml -f docker-compose.yml up -d
down: ## Take down all the containers
docker compose -f docker-compose.db.yml -f docker-compose.yml down -v
clean:
docker volume rm $(docker volume ls -q)
build-swagger: ## Build the swagger docs
go get github.com/swaggo/swag/cmd/swag; \
go get github.com/alecthomas/template; \
go get github.com/riferrei/[email protected]; \
cd src/api && swag init -g routes/api.go
build: ## Build everything
docker compose build
ps: ## List all containers and running status
docker compose -f docker-compose.db.yml -f docker-compose.yml ps
postgres-console: ## Start postgres terminal
docker compose -f docker-compose.db.yml -f docker-compose.yml exec postgres psql -U postgres
redis-console: ## Start redis terminal
docker compose -f docker-compose.db.yml -f docker-compose.yml exec redis redis-cli
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}'