This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (40 loc) · 1.43 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
57
58
59
.PHONY: build build-css certs clean cover down lint migrate-create migrate-down migrate-goto migrate-up start test test-down test-integration test-up up
export NAME := ahead
export MIGRATE_DB_URL := "postgres://${NAME}:123@localhost:5432/${NAME}?sslmode=disable"
build:
docker-compose -p ${NAME} build
build-css:
NODE_ENV=production ./node_modules/.bin/tailwindcss build app.css -o public/styles/app.css
certs: generate_cert.go
go run generate_cert.go --rsa-bits=2048 --host=localhost
clean:
rm -rf data
cover:
go tool cover -html=cover.out
down:
docker-compose -p ${NAME} down
generate_cert.go:
wget "https://raw.githubusercontent.com/golang/go/master/src/crypto/tls/generate_cert.go"
lint:
golangci-lint run
migrate-create:
migrate create -ext sql -dir storage/migrations -seq $(name)
migrate-down:
migrate -path storage/migrations -database ${MIGRATE_DB_URL} down
migrate-goto:
migrate -path storage/migrations -database ${MIGRATE_DB_URL} goto $(version)
migrate-up:
migrate -path storage/migrations -database ${MIGRATE_DB_URL} up
start:
go run cmd/server/*.go start
test:
go test -coverprofile=cover.out -mod=readonly ./...
test-down:
docker-compose -p ${NAME}-test -f docker-compose-test.yaml down
test-integration: test-up
go test -p 1 -coverprofile=cover.out -tags=integration -mod=readonly ./...
test-up:
docker-compose -p ${NAME}-test -f docker-compose-test.yaml up -d
up:
mkdir -p data
docker-compose -p ${NAME} up -d