forked from 2600hz/kazoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.relx.config.script
43 lines (36 loc) · 1.47 KB
/
ci.relx.config.script
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
VSN = case os:getenv("KZ_VERSION") of
'false' -> os:cmd("echo -n $(scripts/next_version 2>/dev/null)");
Version -> Version
end,
ToName = fun (App) -> list_to_atom(hd(string:tokens(App,"-"))) end,
Apps = [list_to_atom(App) || "applications/"++App = Dir <- filelib:wildcard("applications/*"), filelib:is_dir(Dir)],
Core = [list_to_atom(App) || "core/"++App = Dir <- filelib:wildcard( "core/*"), filelib:is_dir(Dir)],
Deps = [list_to_atom(App) || "deps/"++App = Dir <- filelib:wildcard( "deps/*"), filelib:is_dir(Dir)],
ToFilterOut = [rabbitmq_codegen
,'.erlang.mk'
,'ci.erlang.mk'
,'.settings'
,skel
,parse_trans
,meck
,elvis_mk
],
Preparer = fun (List) -> [{E,load} || E <- List, not lists:member(E, ToFilterOut)] end,
Base = [tools
,sasl
,eunit
,common_test
],
BASE = [{default_release, {kazoo, VSN}}
,{release, {kazoo, VSN}
,Base ++ Preparer(Apps ++ Core ++ Deps)
}],
APPS = [begin
{ok, [{application, App, Settings}]} = file:consult(list_to_binary(["applications/", atom_to_list(App), "/ebin/", atom_to_list(App), ".app"])),
AppDeps = proplists:get_value(applications, Settings, []),
{release, {App, VSN}, Base ++ Preparer(AppDeps)}
end
|| App <- Apps,
not lists:member(App, ToFilterOut)
],
CONFIG ++ BASE ++ APPS.