-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
117 lines (93 loc) · 2.36 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
.PHONY: clean
clean:
rm -f internal/postgres/work_db/schema/db.go
rm -f internal/postgres/work_db/schema/models.go
rm -f internal/postgres/work_db/schema/query.sql.go
rm -f internal/postgres/search_db/schema/db.go
rm -f internal/postgres/search_db/schema/models.go
rm -f internal/postgres/search_db/schema/query.sql.go
rm -f cmd/*/service.exe
.PHONY: generate
generate: config
cd internal/postgres ; make generate
.PHONY: config
config: clean
cd config ; make all || exit 1
docker:
docker build -t jemison/dev -f Dockerfile.dev .
docker build -t jemison/build -f Dockerfile.build .
.PHONY: build
build: generate
echo "build migrate"
cd cmd/migrate ; make build
echo "build admin"
cd cmd/admin ; make build
echo "build entree"
cd cmd/entree ; make build
echo "build extract"
cd cmd/extract ; make build
echo "build fetch"
cd cmd/fetch ; make build
echo "build pack"
cd cmd/pack ; make build
echo "build serve"
cd cmd/serve ; make build
# echo "build validate"
# cd cmd/validate ; make build
echo "build walk"
cd cmd/walk ; make build
.PHONY: lint
lint: generate
golangci-lint run -v
.PHONY: containerlint
containerlint:
docker run -v ${PWD}:/app -t jemison/build lint
.PHONY: up
up: build
docker compose up
multi: build
docker compose -f multi.yaml up \
--scale entree=1 \
--scale fetch=1 \
--scale extract=4 \
--scale walk=4
.PHONY: backend
backend:
docker compose -f backend.yaml up
.PHONY:
macup:
docker run -v ${PWD}:/app -t jemison/build
docker compose up
.PHONY: run
run: clean generate
cd assets ; unzip -qq -o static.zip > /dev/null 2>&1
docker compose up
.PHONY: cloc
cloc:
docker run --rm -v ${PWD}:/tmp aldanial/cloc --exclude-dir=assets .
delete_admin:
cf delete -f admin
delete_entree:
cf delete -f entree
delete_extract:
cf delete -f extract
delete_fetch:
cf delete -f fetch
delete_pack:
cf delete -f pack
delete_serve:
cf delete -f serve
delete_walk:
cf delete -f walk
.PHONY: delete_all
delete_all: delete_admin delete_entree delete_extract delete_fetch delete_pack delete_serve delete_walk
# I need to delete_all every time, because there is not enough RAM
# in the sandbox to rolling deploy
.PHONY: terraform
terraform: delete_all
docker run -v ${PWD}:/app -t jemison/build
cd terraform ; make apply_all
.PHONY: docker_full_clean
docker_full_clean:
-docker stop $(docker ps -a -q)
-docker rm $(docker ps -a -q)