-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (30 loc) · 1.14 KB
/
Makefile
File metadata and controls
43 lines (30 loc) · 1.14 KB
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
RELEASE_TAG := $(shell ./release.sh 2> /dev/null)
all: src deploy
src: apiserver webapp
protos: proto-greeter
webapp: build-webapp push-webapp
apiserver: build-apiserver push-apiserver
schema:
cd src/apiserver/internal && entc generate ./ent/schema
#--go_opt=paths=source_relative
proto-%:
cd src/apiserver/$*/pb && protoc --proto_path=$(GOPATH)/src:. \
--twirp_out=. \
--go_out=. \
--descriptor_set_out=$*.pb \
$*.proto
deploy: generate-apiserver generate-webapp generate-postgres
kustomize build deploy/ > deploy/manifest.yaml
kubectl apply -f deploy/manifest.yaml
generate-%:
cd deploy/$*/ && kustomize edit set image app-$*=registry.digitalocean.com/jwtracy-personal/app-$*:$(RELEASE_TAG)
cd deploy/$*/ && kustomize build > manifest.yaml
build-%: generate-apiserver protos
docker build -t registry.digitalocean.com/jwtracy-personal/app-$*:$(RELEASE_TAG) \
src/$*/
push-%:
docker push registry.digitalocean.com/jwtracy-personal/app-$*:$(RELEASE_TAG)
clean:
find deploy -name manifest.yaml -delete
find \( -wholename "*/pb/*.twirp.go" -o -wholename "*/pb/*.pb.go" -o -wholename "*/pb/*.pb" \) -delete
.PHONY: deploy apiserver