-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD
41 lines (36 loc) · 1.55 KB
/
BUILD
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
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
exports_files(["envoy_upstream.yaml", "envoy_downstream.yaml"])
go_binary(
name = "helloworld",
srcs = [
"main.go"
],
deps = [
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//examples/helloworld/helloworld:go_default_library",
"@org_golang_google_grpc//reflection:go_default_library",
"@org_golang_x_net//context:go_default_library"
],
data = [
"envoy_downstream",
"envoy_upstream"
]
)
#### Downstream ####
genrule(
name = "envoy_downstream",
outs = ["envoy-upstream"],
srcs = ["//conf:envoy_downstream.yaml"],
cmd = "docker rm -f envoy_downstream || true; docker run -d -p 6552:6552 -v `(pwd)`/`dirname $(location //conf:envoy_downstream.yaml)`:/usr/local/envoy/conf --name envoy_downstream envoyproxy/envoy:4dd49d8809f7aaa580538b3c228dd99a2fae92a4 envoy -l trace -c /usr/local/envoy/conf/envoy_downstream.yaml > $@; sleep 5",
local = 1,
visibility = ["//visibility:public"],
)
#### Upstream ####
genrule(
name = "envoy_upstream",
outs = ["envoy-downstream"],
srcs = ["//conf:envoy_upstream.yaml"],
cmd = "docker rm -f envoy_upstream || true; docker run -d -p 6553:6553 -v `(pwd)`/`dirname $(location //conf:envoy_upstream.yaml)`:/usr/local/envoy/conf --name envoy_upstream envoyproxy/envoy:4dd49d8809f7aaa580538b3c228dd99a2fae92a4 envoy -l trace -c /usr/local/envoy/conf/envoy_upstream.yaml > $@; sleep 5",
local = 1,
visibility = ["//visibility:public"],
)