-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (54 loc) · 1.57 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
run: build
@./bin/wits
install:
go install github.com/a-h/templ/cmd/templ@latest
go install golang.org/x/tools/cmd/godoc@latest
npm install
build:
curl -L -o public/js/htmx.min.js https://unpkg.com/htmx.org@1.9.12/dist/htmx.min.js
cp ./node_modules/jquery/dist/jquery.min.js public/js/jquery.min.js
cp ./node_modules/font-awesome/css/font-awesome.min.css public/css/font-awesome.min.css
cp ./node_modules/font-awesome/fonts/* public/fonts/
npx tailwindcss -i pkg/view/css/app.css -o public/css/styles.css
templ generate view
go build -v -o ./bin/wits ./cmd/server/main.go
build-image:
podman build -t thedondope/wits .
push-image: build-image
podman tag thedondope/wits ghcr.io/thedondope/wits:latest
podman push ghcr.io/thedondope/wits:latest
k8s-up:
kubectl apply -f k8s/
k8s-down:
kubectl delete -f k8s/
clean:
rm -f ./bin/wits
rm -f coverage.html
rm -f coverage.out
rm -rf log
rm -rf node_modules
rm -rf tmp
rm -rf vendor
doc:
godoc
test:
go test -race -v ./... -coverprofile coverage.out
test-ci:
go test -race -v ./... -coverprofile coverage.out -covermode=atomic
bash -c "bash <(curl -s https://codecov.io/bash)"
cover: test
go tool cover -html coverage.out -o coverage.html
show-cover: cover
open coverage.html
vet:
go vet ./...
up: ## Database migration up
go run cmd/migrate/main.go up
drop:
go run cmd/drop/main.go up
down: ## Database migration down
go run cmd/migrate/main.go down
migration: ## Migrations against the database
migrate create -ext sql -dir cmd/migrate/migrations $(filter-out $@,$(MAKECMDGOALS))
seed:
go run cmd/seed/main.go