-
Notifications
You must be signed in to change notification settings - Fork 1
/
rebar.config.script
42 lines (31 loc) · 1.41 KB
/
rebar.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
CONFIG1 = case os:getenv("TRAVIS") of
"true" ->
JobId = os:getenv("TRAVIS_JOB_ID"),
[{coveralls_service_job_id, JobId},
{coveralls_coverdata, "_build/test/cover/*.coverdata"},
{coveralls_service_name , "travis-ci"} | CONFIG];
_ ->
CONFIG
end,
CUR_BRANCH = os:cmd("git branch | grep -e '^*' | cut -d' ' -f 2") -- "\n",
MATCH_BRANCH = fun (BranchName) when BranchName =:= "master";
BranchName =:= "develop" ->
BranchName;
(BranchName) ->
case string:prefix(BranchName, "release") of
nomatch -> "develop";
_Match -> BranchName
end
end,
BRANCH = MATCH_BRANCH(CUR_BRANCH),
DEPS = case lists:keyfind(deps, 1, CONFIG1) of
{_, Deps} -> Deps;
_ -> []
end,
UrlPrefix = "https://github.com/emqx/",
EMQX_DEP = {emqx, {git, UrlPrefix ++ "emqx", {branch, BRANCH}}},
EMQX_BRIDGE_MQTT_DEP = {emqx_bridge_mqtt, {git, UrlPrefix ++ "emqx-bridge-mqtt", {branch, BRANCH}}},
EMQX_MGMT_DEP = {emqx_management, {git, UrlPrefix ++ "emqx-management", {branch, BRANCH}}},
NewDeps = [EMQX_DEP, EMQX_MGMT_DEP, EMQX_BRIDGE_MQTT_DEP | DEPS],
CONFIG2 = lists:keystore(deps, 1, CONFIG1, {deps, NewDeps}),
CONFIG2.