-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrebar.config
227 lines (205 loc) · 7.84 KB
/
rebar.config
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
%% behaviours should be compiled before other files
{erl_first_files, [
"src/cluster_elements/worker_host/worker_plugin_behaviour.erl",
"src/http/rest/protocol_plugin_behaviour.erl"
]}.
%% eunit opts - Maven-like output formatting
{eunit_opts, [verbose, {report, {eunit_surefire, [{dir, "./test/eunit_results"}]}}]}.
%% Test coverage
{cover_enabled, true}.
{dialyzer, [
{warnings, [error_handling, unknown]},
{plt_extra_apps, [
ranch, ctool, cluster_manager, cluster_worker, gen_server2, macaroons, cberl, gui,
cowboy, cowlib, compiler, jiffy, eunit, poolboy, gproc, rtransfer_link,
rrdtool, helpers, enif_protobuf, common_test, backoff, clproto,
worker_pool, bp_tree, ssl, onenv_ct, base64url
]}
]}.
%% deps options
{deps, [
{compatibility_reference, {raw, {git, "ssh://[email protected]:7999/vfs/compatibility-reference.git", {ref, "afaafcbba44a"}}}},
{ctool, {git, "ssh://[email protected]:7999/vfs/ctool.git", {ref, "faa2ee73aad9"}}},
{cluster_manager, {raw, {git, "ssh://[email protected]:7999/vfs/cluster-manager.git", {ref, "b0184b1d58c2"}}}},
{cluster_worker, {git, "ssh://[email protected]:7999/vfs/cluster-worker.git", {ref, "4b816022da6431d"}}},
{enif_protobuf, {git, "https://github.com/jg513/enif_protobuf", {ref, "9c897ea1d0940"}}},
{clproto, {git, "ssh://[email protected]:7999/vfs/clproto.git", {ref, "9b05cbc02812"}}},
{rrdtool, {git, "https://github.com/mwrona/erlang-rrdtool.git", "master"}},
{poolboy, {git, "https://github.com/devinus/poolboy.git", {ref, "9212a8770edb"}}},
{gen_server_mock, {git, "git://github.com/brucexin/gen_server_mock.git", {ref, "de3cd8e"}}},
{helpers, {git, "ssh://[email protected]:7999/vfs/helpers.git", {ref, "4e3afefa7774c035"}}},
{rtransfer_link, {git, "ssh://[email protected]:7999/vfs/rtransfer_link.git", {ref, "6f837c3798d2745a"}}},
{onenv_ct, {git, "ssh://[email protected]:7999/vfs/onenv-ct.git", {ref, "aabfcfae0a91"}}}
]}.
%% plugins
{plugins, [rebar3_hex, rebar3_elixir,
{rebar_raw_resource, {git, "https://github.com/alertlogic/rebar_raw_resource", {branch, "master"}}}
]}.
%% pre-hooks
{pre_hooks, [
{eunit, "mkdir -p test/eunit_results"}, %% Make dir for eunit' surefire test results
%% Sometimes, in some cases epmd daemon doesn't start during eunit tests,
%% so we need to force start it
{eunit, "epmd -daemon"},
%% NIFs compilation
{compile, "mkdir -p priv"},
{compile, "make -C c_src"}
]}.
{post_hooks, [
{compile, "rm -rf priv/*.a"},
{release, "rm -f _build/*/rel/op_worker/bin/install_upgrade.escript"},
{release, "rm -f _build/*/rel/op_worker/bin/nodetool"},
{release, "rm -f _build/*/rel/op_worker/bin/op_worker-*"},
{release, "rm -f _build/*/rel/op_worker/bin/start_clean.boot"},
{release, "rm -f _build/*/rel/op_worker/bin/no_dot_erlang.boot"}
]}.
%% Cleanup
{clean_files, [
"./c_src/*/*.o",
"./test/eunit_results",
"./priv/*.so",
"./test_distributed/logs/*",
"./test_distributed/*.beam"
]}.
%% Erlang options, defines
{erl_opts, [
{src_dirs, ["src"]}
]}.
%% Add the tuple below to erl_opts proplist to turn on lager parse transform
%% (this is not needed as long as ctool logger is used)
%% {parse_transform, lager_transform}
%% Add the tuple below to erl_opts proplist to completely turn off debug messages
%% {d, skip_debug}
%% lager configuration
{lager_extra_sinks, [file_access_audit]}.
%% relx configuration
{relx, [
{release, {op_worker, "1.0.0"},
[
kernel,
stdlib,
xmerl,
sasl,
public_key,
lager,
crypto,
inets,
clproto,
gui,
mnesia,
% All ctool deps will be included in the release package,
% so there is no need to list them here.
ctool,
{cberl, load},
{enif_protobuf, load},
{bp_tree, load},
{cluster_worker, load},
{observer_cli, load},
{gen_server2, load},
%% deps included by default by reltool but not included by relx
{base64url, load},
certifi,
{common_test, load},
{debugger, load},
{edoc, load},
{enacl, load},
{erts, load},
{eunit, load},
hackney,
{iso8601, load},
{jiffy, load},
{macaroons, load},
{observer, load},
{poolboy, load},
{rrdtool, load},
{runtime_tools, load},
{snmp, load},
{wx, load},
{backoff, load},
{uuid, load},
gproc,
{rtransfer_link, load},
op_worker
]},
{vm_args, "rel/files/vm.args"},
{sys_config, "rel/files/app.config"},
{include_src, false},
{dev_mode, true},
% NOTE: {dev_mode, true} expands implicitly to {include_erts, false},
% so we need this line AFTER the dev mode to override this setting
{include_erts, true},
{overlay, [
%% Copy base files for starting and interacting with node
{copy, "node_package/priv/base/erl", "erts-{{erts_vsn}}/bin/erl"},
{copy, "node_package/priv/base/nodetool", "erts-{{erts_vsn}}/bin/nodetool"},
{template, "node_package/priv/base/runner", "bin/op_worker"},
{template, "node_package/priv/base/env.sh", "lib/env.sh"},
%% Copy config files
{mkdir, "etc"},
{copy, "rel/files/config.d", "etc/"},
{copy, "rel/files/autogenerated.config", "etc/"},
{template, "rel/files/autogenerated.vm.args", "etc/autogenerated.vm.args"},
%% Copy cert dirs
{copy, "rel/files/certs", "etc/"},
{copy, "rel/files/cacerts", "etc/"},
% Copy the compatibility reference:
% 1) Default compatibility reference for this software version
{copy,
"_build/default/lib/compatibility_reference/compatibility.json",
"./data/compatibility.default.json"
},
% 2) Placeholder for the dynamic compatibility file that can be
% overwritten by a newer registry when such is available. Will not
% overwrite the older one in case of upgrade, as the etc dir is
% persisted.
{copy,
"_build/default/lib/compatibility_reference/compatibility.json",
"./etc/compatibility.json"
},
%% Copy additional data files
{mkdir, "data"},
{copy, "LICENSE.txt", "./data/"},
{template, "rel/files/app.config", "data/app.config"},
{template, "rel/files/vm.args", "data/vm.args"},
% Oneprovider GUI static files
{copy, "_build/default/lib/gui_static.tar.gz", "./data/"}
]},
{extended_start_script, true}
]}.
%% Profiles configuration
{profiles, [
{package, [
{relx, [{dev_mode, false}]}
]},
{bamboo, [
{relx, [{dev_mode, false}]},
{post_hooks, [
{release, "rm -rf _build/default/rel"},
{release, "mv -f _build/bamboo/rel _build/default"},
{release, "rm -rf _build/default/lib/op_worker"},
{release, "mv -f _build/bamboo/lib/op_worker _build/default/lib"}
]}
]}
]}.
{overrides, [
{override, enif_protobuf, [
{pre_hooks, [
{"(linux|darwin|solaris)", compile, "make -C c_src"},
{"(freebsd|openbsd)", compile, "gmake -C c_src"}
]},
{post_hooks, [
{"(linux|darwin|solaris)", clean, "make -C c_src clean"},
{"(freebsd|openbsd)", clean, "gmake -C c_src clean"}
]},
{plugins, [{pc, "~> 1.0"}]},
{artifacts, ["priv/enif_protobuf.so"]},
{provider_hooks, [
{post,
[
{compile, {pc, compile}},
{clean, {pc, clean}}
]
}]
}
]}
]}.