-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD
47 lines (42 loc) · 1021 Bytes
/
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
42
43
44
45
46
47
# Go boilerplate
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_push",
"container_bundle",
)
go_binary(
name = "hello",
srcs = ["main.go"],
importpath = ".",
)
go_image(
name = "go_image",
srcs = ["main.go"],
importpath = ".",
)
container_push(
name = "push",
format = "Docker",
image = ":go_image",
registry = "index.docker.io",
repository = "orangesys/bazel-go-hello-world",
stamp = True,
)
container_bundle(
name = "bundle_to_push",
images = {
"index.docker.io/orangesys/bazel-go-hello-world:{VERSION}": ":go_image",
"index.docker.io/orangesys/bazel-go-hello-world:latest": ":go_image",
},
stamp = True,
)
load(
"@io_bazel_rules_docker//contrib:push-all.bzl",
docker_pushall = "docker_push",
)
docker_pushall(
name = "push_bundle",
bundle = ":bundle_to_push",
)