forked from cloudforet-io/api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (47 loc) · 1.39 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
TARGET = all
VERSION = v1
DOCKER_NAME = spaceone/api_builder
.PHONY: help
.PHONY: all python go gateway json
.PHONY: clean
define banner
@echo "========================================================================"
@echo " $(1)"
@echo "========================================================================"
endef
define set_build_env
git submodule init
git submodule update
docker build --platform=linux/x86_64 -t ${DOCKER_NAME} .
endef
define build
$(call set_build_env)
$(call banner, "Start the build protobuf")
docker run -i --rm -v ${PWD}:/opt ${DOCKER_NAME} python3 build.py ${TARGET} -c$(1)
endef
help:
@echo "Make Options:"
@echo " all - Generate all"
@echo " python - Generate python protobuf"
@echo " go - Generate go protobuf"
@echo " gateway - Generate gateway protobuf"
@echo " json - Generate API artifact json files"
@echo " clean - Clean up dist directory"
all:
$(call banner, "Generate all : ${TARGET}")
$(call build, "all")
json:
$(call banner, "Generate API json files")
$(call build, "json")
python:
$(call banner, "Generate python protobuf")
$(call build, "python")
go:
$(call banner, "Generate go protobuf")
$(call build, "go")
gateway:
$(call banner, "Generate gateway protobuf")
$(call build, "gateway")
clean:
$(call banner, "Clean up dist directory")
sudo rm -rf dist