-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (27 loc) · 824 Bytes
/
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
include .envrc
MIGRATION_PATH=./cmd/migrate/migrations
DB_ADDR=postgres://admin:adminpassword@localhost/social?sslmode=disable
.PHONY: migrate-create
migrate-create:
@migrate create -seq -ext sql -dir $(MIGRATION_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: migrate-up
migrate-up:
@migrate -path=$(MIGRATION_PATH) -database=$(DB_ADDR) up
.PHONY: migrate-down
migrate-down:
@migrate -path=$(MIGRATION_PATH) -database=$(DB_ADDR) down $(filter-out $@,$(MAKECMDGOALS))
.PHONY: seed
seed:
@go run ./cmd/migrate/seed/main.go
.PHONY: gen-docs
gen-docs:
@swag init -g ./api/main.go -d cmd,internal && swag fmt
.PHONY: test
test:
@go test -v ./...
.PHONY: build
build:
@docker-compose up --build
.PHONY: testing-api
testing-api:
@npx autocannon -r 22 -d 1 -c 1 --renderStatusCodes http://localhost:8080/v1/health