-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
40 lines (33 loc) · 1023 Bytes
/
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
HAS_PROTOC := $(shell command -v protoc 2> /dev/null)
HAS_PROTOGENDOC := $(shell command -v protoc-gen-doc 2> /dev/null)
all: build
images:
$(MAKE) -C docs/images
build: ./venv api images docs/reference.md
bash -c "source venv/bin/activate && \
mkdocs build"
serve: ./venv api images docs/reference.md
bash -c "source venv/bin/activate && \
mkdocs serve"
api:
ifndef DOCKER_PROTO
docker run \
--privileged --rm \
-v $(shell pwd):/go/src/code \
-e "GOPATH=/go" \
-e "DOCKER_PROTO=yes" \
-e "PROTO_USER=$(shell id -u)" \
-e "PROTO_GROUP=$(shell id -g)" \
-e "PATH=/bin:/usr/bin:/usr/local/bin:/go/bin:/usr/local/go/bin" \
quay.io/openstorage/grpc-framework:latest \
make api
else
bash getcontent.sh
endif
docs/reference.md: api
./venv:
python3 -m venv venv
bash -c "source venv/bin/activate && \
pip3 install -r requirements.txt"
@echo "Type: 'source venv/bin/active' to get access to mkdocs"
.PHONY: all build serve images api