forked from buchgr/bazel-remote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
66 lines (60 loc) · 1.79 KB
/
BUILD.bazel
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
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push")
gazelle(
name = "gazelle",
prefix = "github.com/buchgr/bazel-remote",
)
go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "github.com/buchgr/bazel-remote",
visibility = ["//visibility:private"],
deps = [
"//cache:go_default_library",
"//cache/disk:go_default_library",
"//cache/gcs:go_default_library",
"//cache/http:go_default_library",
"//config:go_default_library",
"//server:go_default_library",
"@com_github_abbot_go_http_auth//:go_default_library",
"@com_github_urfave_cli//:go_default_library",
],
)
go_binary(
name = "bazel-remote",
embed = [":go_default_library"],
pure = "on",
static = "on",
visibility = ["//visibility:public"],
x_defs = {"github.com/buchgr/bazel-remote/server.GitCommit": "{STABLE_GIT_COMMIT}"},
)
go_image(
name = "bazel-remote-base",
embed = [":go_default_library"],
pure = "on",
static = "on",
visibility = ["//visibility:private"],
)
container_image(
name = "bazel-remote-image",
base = ":bazel-remote-base",
cmd = ["--max_size=5"],
entrypoint = [
"/app/bazel-remote-base.binary",
"--port=8080",
"--dir=/data",
],
ports = ["8080"],
visibility = ["//visibility:public"],
)
container_push(
name = "push_to_dockerhub",
format = "Docker",
image = ":bazel-remote-image",
registry = "index.docker.io",
repository = "buchgr/bazel-remote-cache",
tag = "latest",
visibility = ["//visibility:public"],
)