-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathBUILD.bazel
More file actions
116 lines (109 loc) · 4.42 KB
/
BUILD.bazel
File metadata and controls
116 lines (109 loc) · 4.42 KB
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
load("@com_github_buildbarn_bb_browser_npm//:purgecss/package_json.bzl", purgecss_bin = "bin")
load("@com_github_buildbarn_bb_storage//tools:container.bzl", "container_push_official", "multiarch_go_image")
load("@rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "bb_browser_lib",
srcs = [
"browser_service.go",
"main.go",
],
embedsrcs = [
"favicon.png",
"stylesheet.css",
"templates/error.html",
"templates/footer.html",
"templates/header.html",
"templates/page_action.html",
"templates/page_command.html",
"templates/page_directory.html",
"templates/page_previous_execution_stats.html",
"templates/page_tree.html",
"templates/page_welcome.html",
"templates/view_action_timestamp_delta.html",
"templates/view_arguments.html",
"templates/view_command.html",
"templates/view_directory.html",
"templates/view_log.html",
"templates/view_previous_execution_stats.html",
],
importpath = "github.com/buildbarn/bb-browser/cmd/bb_browser",
visibility = ["//visibility:private"],
deps = [
"//pkg/proto/configuration/bb_browser",
"//pkg/proto/query",
"@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto",
"@com_github_buildbarn_bb_remote_execution//pkg/builder",
"@com_github_buildbarn_bb_remote_execution//pkg/filesystem/access",
"@com_github_buildbarn_bb_remote_execution//pkg/proto/cas",
"@com_github_buildbarn_bb_remote_execution//pkg/proto/resourceusage",
"@com_github_buildbarn_bb_storage//pkg/auth/configuration",
"@com_github_buildbarn_bb_storage//pkg/blobstore",
"@com_github_buildbarn_bb_storage//pkg/blobstore/configuration",
"@com_github_buildbarn_bb_storage//pkg/clock",
"@com_github_buildbarn_bb_storage//pkg/digest",
"@com_github_buildbarn_bb_storage//pkg/filesystem/path",
"@com_github_buildbarn_bb_storage//pkg/global",
"@com_github_buildbarn_bb_storage//pkg/http",
"@com_github_buildbarn_bb_storage//pkg/jmespath",
"@com_github_buildbarn_bb_storage//pkg/program",
"@com_github_buildbarn_bb_storage//pkg/proto/auth",
"@com_github_buildbarn_bb_storage//pkg/proto/fsac",
"@com_github_buildbarn_bb_storage//pkg/proto/iscc",
"@com_github_buildbarn_bb_storage//pkg/util",
"@com_github_buildkite_terminal_to_html//:terminal-to-html",
"@com_github_dustin_go_humanize//:go-humanize",
"@com_github_gorilla_mux//:mux",
"@com_github_kballard_go_shellquote//:go-shellquote",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//metadata",
"@org_golang_google_grpc//status",
"@org_golang_google_protobuf//encoding/protojson",
"@org_golang_google_protobuf//proto",
"@org_golang_google_protobuf//types/known/anypb",
"@org_golang_google_protobuf//types/known/timestamppb",
"@org_gonum_v1_plot//:plot",
"@org_gonum_v1_plot//plotter",
"@org_gonum_v1_plot//vg",
"@org_gonum_v1_plot//vg/draw",
],
)
filegroup(
name = "templates",
srcs = glob(["templates/*.html"]),
)
purgecss_bin.purgecss_binary(
name = "purgecss",
tags = ["manual"],
)
# Create a copy of Bootstrap that only contains the style attributes
# used by the HTML templates. Also include the classes needed by
# terminal-to-html.
genrule(
name = "stylesheet",
srcs = [
"@com_github_buildkite_terminal_to_html//assets:terminal.css",
"@com_github_twbs_bootstrap//:css/bootstrap.min.css",
":templates",
],
outs = ["stylesheet.css"],
cmd = " && ".join([
"BAZEL_BINDIR=$(BINDIR) $(location :purgecss) --css $${PWD}/$(location @com_github_twbs_bootstrap//:css/bootstrap.min.css) --content $$(for i in $(locations templates); do echo $${PWD}/$${i}; done) --output $${PWD}/$@ --safelist bg-secondary",
"cat $(location @com_github_buildkite_terminal_to_html//assets:terminal.css) >> $@",
]),
tools = [":purgecss"],
)
go_binary(
name = "bb_browser",
embed = [":bb_browser_lib"],
pure = "on",
visibility = ["//visibility:public"],
)
multiarch_go_image(
name = "bb_browser_container",
binary = ":bb_browser",
)
container_push_official(
name = "bb_browser_container_push",
component = "bb-browser",
image = ":bb_browser_container",
)