forked from rabbitmq/rabbitmq-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
124 lines (109 loc) · 3.18 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
119
120
121
122
123
124
load("elixir_home.bzl", "elixir_home")
load(":rabbitmq_home.bzl", "rabbitmq_home")
load(":rabbitmq_run.bzl", "rabbitmq_run", "rabbitmq_run_command")
load(":rabbitmqctl.bzl", "rabbitmqctl")
load(":rabbitmq.bzl", "management_plugins", "required_plugins")
exports_files([
"scripts/bazel/rabbitmq-run.sh",
])
# This allows us to
# `bazel build //my/target \
# --//:elixir_home=/path/to/elixir/installation`
elixir_home(
name = "elixir_home",
build_setting_default = "~/.kiex/elixirs/elixir-1.10.4",
visibility = ["//visibility:public"],
)
platform(
name = "erlang_22_platform",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
"@bazel_tools//tools/cpp:clang",
],
exec_properties = {
"OSFamily": "Linux",
"container-image": "docker://pivotalrabbitmq/rabbitmq-server-buildenv:linux-erlang-22.3",
},
)
platform(
name = "erlang_23_platform",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
"@bazel_tools//tools/cpp:clang",
],
exec_properties = {
"OSFamily": "Linux",
"container-image": "docker://pivotalrabbitmq/rabbitmq-server-buildenv:linux-erlang-23.2",
},
)
rabbitmq_home(
name = "broker-home",
plugins = required_plugins(rabbitmq_workspace = "@"),
)
rabbitmq_home(
name = "broker-management-home",
plugins = required_plugins(rabbitmq_workspace = "@") + management_plugins(rabbitmq_workspace = "@"),
)
rabbitmq_home(
name = "broker-for-tests-home",
testonly = True,
plugins = [
"//deps/rabbit:test_bazel_erlang_lib", # <- compiled with test erlc_opts
"@rabbitmq_ct_client_helpers//:bazel_erlang_lib",
"@inet_tcp_proxy//:bazel_erlang_lib",
"@meck//:bazel_erlang_lib",
],
)
rabbitmq_home(
name = "broker-for-cli-tests-home",
plugins = required_plugins(rabbitmq_workspace = "@") + [
"//deps/rabbitmq_federation:bazel_erlang_lib",
"//deps/rabbitmq_stomp:bazel_erlang_lib",
"//deps/amqp_client:bazel_erlang_lib",
],
)
rabbitmq_run(
name = "rabbitmq-run",
home = ":broker-home",
visibility = ["//visibility:public"],
)
rabbitmq_run(
name = "rabbitmq-management-run",
home = ":broker-management-home",
visibility = ["//visibility:public"],
)
rabbitmq_run(
name = "rabbitmq-for-tests-run",
testonly = True,
home = ":broker-for-tests-home",
visibility = ["//visibility:public"],
)
rabbitmq_run(
name = "rabbitmq-for-cli-tests-run",
testonly = True,
home = ":broker-for-cli-tests-home",
visibility = ["//visibility:public"],
)
# Allow us to `bazel run broker`
# for the equivalent of `make run-broker`
# (though it as of yet includes no plugins)
rabbitmq_run_command(
name = "broker",
rabbitmq_run = ":rabbitmq-run",
subcommand = "run-broker",
)
# `bazel run broker-management` for the broker with just the
# management plugin
rabbitmq_run_command(
name = "broker-management",
rabbitmq_run = ":rabbitmq-management-run",
subcommand = "run-broker",
)
# `bazel run rabbitmqctl`
rabbitmqctl(
name = "rabbitmqctl",
home = ":broker-home",
visibility = ["//visibility:public"],
)