-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (42 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
run:
LOG_APP_LEVEL="debug" \
JWT_KEY="YourJWTKeyHere" \
APP_KEY="YourAPPKeyHere" \
MAILGUN_DOMAIN="mailer.acme.com" \
MAILGUN_API_KEY="YourMailgunAPIKey" \
MAIL_FROM="[email protected]" \
DB_STRING="postgres://postgres:YourPostgresPassword@localhost:5432/acme_dev?sslmode=disable" \
go run ./cmd/http
build-individual:
(cd ./cmd/$(dir)/ && GOOS=darwin GOARCH=amd64 go build -o main-darwin.bin)
(cd ./cmd/$(dir)/ && GOOS=linux GOARCH=arm64 go build -o main-linux-arm64.bin)
build:
for dir in $$(ls -d ./cmd/*/); do \
make build-individual dir=$$(basename $$dir); \
done
clean:
rm -f ./cmd/*/*.bin
deploy:
fly deploy
remove-ds-store:
find . -name .DS_Store -delete
swagger:
swag init -d cmd/http/ --parseDependency --parseInternal
dbproxy:
make dbstart && fly proxy 5432 -a pg-prod-acme-com
dbstart:
(cd migrations && fly machines start)
dbstop:
(cd migrations && fly machines stop)
goose:
GOOSE_DRIVER=postgres GOOSE_DBSTRING="postgres://postgres:YourPostgresPassword@localhost:5432/acme_dev" goose -dir=migrations $(filter-out $@,$(MAKECMDGOALS))
ci:
go mod tidy
go mod verify
test:
go test -v ./...
coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
%:
@: