forked from infobloxopen/protoc-gen-atlas-query-validate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (33 loc) · 1.19 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
GOPATH ?= $(HOME)/go
SRCPATH := $(patsubst %/,%,$(GOPATH))/src
# configuration for the protobuf gentool
PROJECT_ROOT := github.com/infobloxopen/protoc-gen-atlas-query-validate
SRCROOT_ON_HOST := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
SRCROOT_IN_CONTAINER := /go/src/$(PROJECT_ROOT)
DOCKERPATH := /go/src
DOCKER_RUNNER := docker run --rm
DOCKER_RUNNER += -v $(SRCROOT_ON_HOST):$(SRCROOT_IN_CONTAINER)
DOCKER_GENERATOR := infoblox/atlas-gentool:v19.1
GENERATOR := $(DOCKER_RUNNER) $(DOCKER_GENERATOR)
default: install
.PHONY: options
options:
@$(GENERATOR) \
--gogo_out="Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:$(DOCKERPATH)" \
options/query_validate.proto
.PHONY: install
install:
go install
.PHONY: example
example: gentool
$(DOCKER_RUNNER) infoblox/atlas-gentool:atlas-validate-query-dev \
--atlas-query-validate_out=":$(DOCKERPATH)" example/example.proto
test: example
go test ./...
.PHONY: vendor
vendor:
dep ensure -vendor-only
.PHONY: gentool
gentool:
docker build -t infoblox/atlas-gentool:atlas-validate-query-dev .
docker image prune -f --filter label=stage=server-intermediate