Created
August 30, 2016 02:59
-
-
Save umegaya/3f693c7c484e5b8dd2ec56a34d73efd7 to your computer and use it in GitHub Desktop.
odb/protobuf docker example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define call_protoc | |
docker run --rm -v `pwd`:/mgo umegaya/protobuf bash -c "cd /mgo && protoc $1" | |
endef | |
define call_odb | |
docker run --rm -v `pwd`:/mgo umegaya/odb bash -c "cd /mgo && odb -I/usr/include/odb -d $1 -o $(MODEL_OUT_PATH) --generate-query --generate-schema $2" | |
endef | |
cproto: | |
$(call call_protoc,--cpp_out=$(OUT_PATH) $(PROTO_FILE)) | |
$(call call_protoc,--grpc_out=$(OUT_PATH) --plugin=protoc-gen-grpc=`which $(GRPC_CPP_PLUGIN)` $(PROTO_FILE)) | |
sproto: | |
$(call call_protoc,--cpp_out=$(SV_OUT_PATH) $(PROTO_FILE)) | |
$(call call_protoc,--grpc_out=$(SV_OUT_PATH) --plugin=protoc-gen-grpc=`which $(GRPC_CPP_PLUGIN)` $(PROTO_FILE)) | |
cmodel: | |
$(call call_odb,sqlite,$(MODEL_PATH)/User.h) | |
smodel: | |
$(call call_odb,mysql,$(MODEL_PATH)/User.h) | |
.PHONY: proto | |
proto: cproto sproto | |
model: cmodel smodel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment