forked from buchgr/bazel-remote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
118 lines (108 loc) · 3.55 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
gazelle(
name = "gazelle",
prefix = "github.com/buchgr/bazel-remote",
)
go_library(
name = "go_default_library",
srcs = [
"main.go",
"rlimit_darwin.go",
"rlimit_unix.go",
"rlimit_windows.go",
],
importpath = "github.com/buchgr/bazel-remote",
visibility = ["//visibility:private"],
deps = [
"//cache:go_default_library",
"//cache/disk:go_default_library",
"//cache/gcsproxy:go_default_library",
"//cache/httpproxy:go_default_library",
"//cache/s3proxy:go_default_library",
"//config:go_default_library",
"//server:go_default_library",
"//utils/idle:go_default_library",
"@com_github_abbot_go_http_auth//:go_default_library",
"@com_github_grpc_ecosystem_go_grpc_prometheus//:go_default_library",
"@com_github_prometheus_client_golang//prometheus/promhttp:go_default_library",
"@com_github_slok_go_http_metrics//metrics/prometheus:go_default_library",
"@com_github_slok_go_http_metrics//middleware:go_default_library",
"@com_github_urfave_cli_v2//:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//credentials:go_default_library",
],
)
go_binary(
name = "bazel-remote",
embed = [":go_default_library"],
pure = "on",
static = "on",
visibility = ["//visibility:public"],
x_defs = {"main.gitCommit": "{STABLE_GIT_COMMIT}"},
)
go_image(
name = "bazel-remote-base",
embed = [":go_default_library"],
goarch = "amd64",
goos = "linux",
pure = "on",
static = "on",
visibility = ["//visibility:private"],
x_defs = {"main.gitCommit": "{STABLE_GIT_COMMIT}"},
)
go_image(
name = "bazel-remote-base-arm64",
embed = [":go_default_library"],
goarch = "arm64",
goos = "linux",
pure = "on",
static = "on",
visibility = ["//visibility:private"],
x_defs = {"main.gitCommit": "{STABLE_GIT_COMMIT}"},
)
container_image(
name = "bazel-remote-image",
base = ":bazel-remote-base",
cmd = ["--max_size=5"],
entrypoint = [
"/app/bazel-remote-base.binary",
"--port=8080",
"--dir=/data",
# Listen on all addresses, not just 127.0.0.1, so this can
# be reached from outside the container (with a -p mapping).
"--profile_host=",
# Specify a port to enable the profiling http server.
"--profile_port=6060",
],
ports = ["8080"],
visibility = ["//visibility:public"],
)
container_image(
name = "bazel-remote-image-arm64",
base = ":bazel-remote-base-arm64",
cmd = ["--max_size=1"],
entrypoint = [
"/app/bazel-remote-base-arm64.binary",
"--port=8080",
"--dir=/data",
# Listen on all addresses, not just 127.0.0.1, so this can
# be reached from outside the container (with a -p mapping).
"--profile_host=",
# Specify a port to enable the profiling http server.
"--profile_port=6060",
],
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"],
)