-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
91 lines (70 loc) · 1.93 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
VERSION ?= latest
VERSION_LOAD_BALANCER ?= $(VERSION)
VERSION_PROXY ?= $(VERSION)
VERSION_TARGET ?= $(VERSION)
VERSION_IPAM ?= $(VERSION)
VERSION_NSP ?= $(VERSION)
VERSION_CTRAFFIC ?= $(VERSION)
VERSION_FRONTEND ?= $(VERSION)
E2E_FOCUS ?= ""
TRAFFIC_GENERATOR_CMD ?= "docker exec -i {trench}"
REGISTRY ?= localhost:5000/meridio
.PHONY: all
all: default
.PHONY: build
build:
docker build -t $(IMAGE) -f ./build/$(IMAGE)/Dockerfile .
.PHONY: tag
tag:
docker tag $(IMAGE) $(REGISTRY)/$(IMAGE):$(VERSION)
.PHONY: push
push:
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
.PHONY: load-balancer
load-balancer:
VERSION=$(VERSION_LOAD_BALANCER) IMAGE=load-balancer $(MAKE) build tag push
.PHONY: proxy
proxy:
VERSION=$(VERSION_PROXY) IMAGE=proxy $(MAKE) build tag push
.PHONY: target
target:
VERSION=$(VERSION_TARGET) IMAGE=target $(MAKE) build tag push
.PHONY: ipam
ipam:
VERSION=$(VERSION_IPAM) IMAGE=ipam $(MAKE) build tag push
.PHONY: nsp
nsp:
VERSION=$(VERSION_NSP) IMAGE=nsp $(MAKE) build tag push
.PHONY: ctraffic
ctraffic:
VERSION=$(VERSION_CTRAFFIC) IMAGE=ctraffic $(MAKE) build tag push
.PHONY: frontend
frontend:
VERSION=$(VERSION_FRONTEND) IMAGE=frontend $(MAKE) build tag push
.PHONY: ipam-proto
ipam-proto:
protoc --go_out=plugins=grpc:. --go_opt=paths=source_relative api/ipam/ipam.proto
.PHONY: nsp-proto
nsp-proto:
protoc --go_out=plugins=grpc:. --go_opt=paths=source_relative api/nsp/nsp.proto
.PHONY: target-proto
target-proto:
protoc --go_out=plugins=grpc:. --go_opt=paths=source_relative api/target/target.proto
.PHONY: proto
proto: ipam-proto nsp-proto target-proto
.PHONY: clear
clear:
.PHONY: default
default: load-balancer proxy target ipam nsp ctraffic frontend
.PHONY: lint
lint:
golangci-lint run ./...
.PHONY: e2e
e2e:
ginkgo --failFast --focus=$(E2E_FOCUS) ./test/e2e/... -- -traffic-generator-cmd=$(TRAFFIC_GENERATOR_CMD)
.PHONY: test
test:
go test -v ./cmd/...
go test -v ./pkg/...
.PHONY: check
check: lint test