-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (70 loc) · 1.95 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
.PHONY: confirm
confirm:
@echo -n 'Are you sure? [y/N] ' && read ans && [ $${ans:-N} = y ]
# ==================================================================================== #
# DEVELOPMENT
# ==================================================================================== #
## run: Run the application
.PHONY: run
run:
./scripts/run.sh
## db: Quickly access the database
.PHONY: db
db:
sqlite3 -box ape.db
## watch: Watches for changes in the Web UI
.PHONY: watch
watch:
templ generate --watch
## gen: Run all generators of the project
.PHONY: gen
gen:
./scripts/migrate.sh up
./scripts/gen-sql.sh
./scripts/gen-templ.sh
## gen-sql: Generate type safe SQL helpers
.PHONY: gen-sql
gen-sql:
./scripts/migrate.sh up
./scripts/gen-sql.sh
## migrate-up: Run SQL migrations up
.PHONY: migrate-up
migrate-up:
./scripts/migrate.sh up
## migrate-down: Run SQL migrations down
.PHONY: migrate-down
migrate-down:
./scripts/migrate.sh down
## build: Builds container images for the project
.PHONY: build
build:
./scripts/build.sh
# ==================================================================================== #
# QUALITY CONTROL
# ==================================================================================== #
## ci: run all CI checks
ci: test audit
## test: test all code
.PHONY: test
test:
./scripts/test.sh
## audit: tidy dependencies, format, vet and run static checks on all code
.PHONY: audit
audit:
./scripts/audit.sh
## vendor: tidy and vendor dependencies
.PHONY: vendor
vendor:
@echo 'Tidying and verifying module dependencies...'
go mod tidy
go mod verify
@echo 'Vendoring dependencies...'
go mod vendor