-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (49 loc) · 1.49 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
GO_MOD="github.com/sourcenetwork/zanzi"
.PHONY: build
build: zanzi-cli zanzid
.PHONY: build-wasm
build-wasm:
GOOS=js GOARCH=wasm go build cmd/zanzid/main.go
.PHONY: zanzi-cli
zanzi-cli:
go build -gcflags="-e" -v -o build/zanzi-cli cmd/zanzi-cli/main.go
.PHONY: zanzid
zanzid:
go build -gcflags="-e" -v -o build/zanzid cmd/zanzid/main.go
.PHONY: proto
proto:
./proto/build-docker.sh
docker run --rm -it --workdir /app/proto --user $(UID):$(GID) -v $(PWD):/app zanzi-proto-builder:latest buf generate --verbose
#sudo mv zanzi/api/* pkg/api/
#sudo mv zanzi/core/* pkg/core/
#sudo rmdir zanzi/api
#sudo rmdir zanzi/core
#sudo rmdir zanzi
#go mod tidy
.PHONY: fmt-proto
fmt-proto:
docker image build --file proto/Dockerfile --tag zanzi-proto-builder:latest proto/
docker run --rm -it --workdir /app/proto --user $(UID):$(GID) -v $(PWD):/app zanzi-proto-builder:latest buf format
.PHONY: test
test:
go test ./...
.PHONY: fmt
fmt:
gofmt -w .
.PHONY: clean
clean:
rm build/*
.PHONY: swagger
swagger:
docker image build --file openapi/nginx.dockerfile -t zanzi-nginx openapi
echo Nginx listening at port 7777
echo Swagger accessible at endpoints /relation_graph/ and /policy/
docker run --rm --publish 7777:80 zanzi-nginx
.PHONY: example
example:
go build -o build/example ./example/embedded/main.go
.PHONY: docs
docs:
docker image build --file devtools/docs.dockerfile -t zanzi-docs .
echo "starting pkgsite in local port 7778"
docker run --rm --publish 7778:8080 --volume .:/app zanzi-docs