-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (44 loc) · 1.05 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
.PHONY: help
help:
@cat Makefile
@echo "no arg supplied"
.PHONY: server
server: gen build
.PHONY: gen
gen:
@hof gen ./example/
.PHONY: build
build:
@go build -o server ./output/cmd/example/
.PHONY: clean
clean:
rm -rf ./.hof/ ./output/ server
.PHONY: db-up
db-up:
docker run -d --rm -it \
--name example-db \
-p 5432:5432 \
-e POSTGRES_DB=example \
-e POSTGRES_USER=example \
-e POSTGRES_PASSWORD=example \
-v ${PWD}/data/db:/var/lib/postgresql/data \
postgres:13
.PHONY: db-down
db-down:
docker rm -f example-db
.PHONY: db-clean
db-clean:
sudo rm -rf ./data/db
.PHONY: dev-nuke
db-nuke: db-down db-clean
.PHONY: psql
psql:
@docker run --rm -it --name psql \
--network host \
postgres:13 \
psql postgresql://example:example@localhost:5432/example
.PHONY: cloc
cloc:
cloc --read-lang-def=$$HOME/hof/jumpfiles/assets/cloc_defs.txt ./example/ ./config/ ./secret/
cloc --read-lang-def=$$HOME/hof/jumpfiles/assets/cloc_defs.txt ./schema/ ./gen/ ./templates/ ./partials/
cloc --read-lang-def=$$HOME/hof/jumpfiles/assets/cloc_defs.txt ./output/