-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (32 loc) · 1.09 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
include .env
confirm:
@echo -n "Are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]
# ============================================================================= #
# BUILD
# ============================================================================= #
build:
go build -o travex ./cmd/*.go
start:
go run ./cmd/*.go
# ============================================================================= #
# QUALITY CONTROL
# ============================================================================= #
audit: vendor
@echo 'Tidying and verifying module dependencies...'
@echo 'Formatting code...'
go fmt ./...
@echo 'Vetting code...'
go vet ./...
staticcheck ./...
@echo 'Running tests...'
go test -race -vet=off ./...
migrateup:
@echo 'Running up migrations...'
migrate -path db/migrations -database ${POSTGRES_URL} -verbose up
seed:
@echo 'Running up seeds..'
migrate -path db/seed -database ${POSTGRES_URL} -verbose up
go run ./db/seed/*.go
migratedown:
migrate -path db/migrations -database {POSTGRES_URL} -verbose down
.PHONY: migrateup migratedown audit build start seed