Skip to content

Commit

Permalink
Merge 01fd922 into b03df49
Browse files Browse the repository at this point in the history
  • Loading branch information
surik committed Jun 10, 2016
2 parents b03df49 + 01fd922 commit 07cfc37
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
rebar.lock
_build
logs
all.coverdata
34 changes: 23 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
before_install:
- sudo apt-get update -qq
- sudo apt-get install avahi-daemon libavahi-compat-libdnssd-dev
- wget https://github.com/rebar/rebar/wiki/rebar
- chmod u+x ./rebar
- wget https://s3.amazonaws.com/rebar3/rebar3
- chmod u+x ./rebar3
- case "$BUILDTOOL" in
rebar3) ./rebar3 update && rm -Rf _build;;
*) "true";;
esac
install: "true"
language: elixir
elixir:
- 1.0.5
- 1.2.0
otp_release:
- 17.5
- 18.0
env:
- BUILDTOOL=rebar
- BUILDTOOL=rebar3
- BUILDTOOL=mix
script:
- mix compile
- rm -Rf deps _build
- ./rebar3 update
- ./rebar3 compile
- rm -Rf _build
- rebar get-deps
- rebar compile
- rebar ct skip_deps=true
after_failure: "cat logs/raw.log"
- case "$BUILDTOOL" in
rebar) ./rebar get-deps compile && ./rebar ct skip_deps=true;;
rebar3) ./rebar3 do compile, yang compile, ct -c, coveralls send;;
mix) mix local.hex --force && MIX_ENV=test mix do deps.get, deps.compile;;
esac
after_failure:
- case "$BUILDTOOL" in
rebar) cat logs/raw/log;;
rebar3) echo "no raw.log on rebar3";;
mix) echo "no raw.log on mix";;
esac
2 changes: 1 addition & 1 deletion cover.spec
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{incl_app, hello, details}.
{export, "logs/all.coverdata"}.
{export, "all.coverdata"}.
22 changes: 11 additions & 11 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%{"abnfc": {:git, "git://github.com/heroku/abnfc.git", "856c77cce8f0dd66bfe95f3ec4041f9f59b742bb", [branch: "master"]},
"bear": {:git, "git://github.com/boundary/bear.git", "119234548783af19b8ec75c879c5062676b92571", [tag: "0.8.2"]},
"certifi": {:hex, :certifi, "0.3.0"},
"cowboy": {:hex, :cowboy, "1.0.3"},
"cowlib": {:hex, :cowlib, "1.0.1"},
"certifi": {:hex, :certifi, "0.3.0", "389d4b126a47895fe96d65fcf8681f4d09eca1153dc2243ed6babad0aac1e763", [:rebar3], []},
"cowboy": {:hex, :cowboy, "1.0.3", "101a5f826ce9a1ebb2ea53a2cdfffc74736e99807e9e492ecd5f26544c04082b", [:rebar, :make], [{:cowlib, "~> 1.0.0", [hex: :cowlib, optional: false]}, {:ranch, "~> 1.0", [hex: :ranch, optional: false]}]},
"cowlib": {:hex, :cowlib, "1.0.1", "175a633c472058bbeb1b238a6409766a48b52b43b7b687ed70f03cf6e854b7d9", [:make], []},
"dnssd": {:git, "https://github.com/benoitc/dnssd_erlang.git", "9b2fdb7ff9618102d82f04e4c68ce191c9aa15ba", [branch: "master"]},
"edown": {:git, "https://github.com/uwiger/edown.git", "c770057f72d2163c718b26e49c572aefe0798ca9", [branch: "master"]},
"ex_uri": {:git, "https://github.com/heroku/ex_uri.git", "16f26db7026493d2934f615f8884fad42675f00e", [branch: "master"]},
Expand All @@ -11,15 +11,15 @@
"folsom": {:git, "git://github.com/boundary/folsom", "38e2cce7c64ce1f0a3a918d90394cfc0a940b1ba", [tag: "0.8.2"]},
"gen_listener_tcp": {:git, "https://github.com/travelping/gen_listener_tcp.git", "3690477d108c7521f84a9af625ba73e525b989d6", [branch: "master"]},
"goldrush": {:git, "https://github.com/DeadZen/goldrush.git", "71e63212f12c25827e0c1b4198d37d5d018a7fec", [tag: "0.1.6"]},
"hackney": {:hex, :hackney, "1.4.8"},
"idna": {:hex, :idna, "1.0.3"},
"jsx": {:hex, :jsx, "2.6.2"},
"lager": {:hex, :lager, "2.1.1"},
"meck": {:hex, :meck, "0.8.3"},
"mimerl": {:hex, :mimerl, "1.0.2"},
"hackney": {:hex, :hackney, "1.4.10", "7da877a7388a8bcc7d71253d4a38103c955333dd470a3af5e47fa1ad8d5e3c23", [:rebar3], [{:ssl_verify_hostname, "1.0.5", [hex: :ssl_verify_hostname, optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, optional: false]}, {:idna, "1.1.0", [hex: :idna, optional: false]}, {:certifi, "0.3.0", [hex: :certifi, optional: false]}]},
"idna": {:hex, :idna, "1.1.0", "b4315c6da1c37dc8ab1df3ed18796ecd5172c4165fb886f43732ce598d145b50", [:rebar3], []},
"jsx": {:hex, :jsx, "2.6.2", "213721e058da0587a4bce3cc8a00ff6684ced229c8f9223245c6ff2c88fbaa5a", [:mix, :rebar], []},
"lager": {:hex, :lager, "2.1.1", "8e389f916384abf5f62169969bd7515c4c252cbbda53feebbef90f47db5eaad1", [:make, :rebar], [{:goldrush, "~> 0.1.6", [hex: :goldrush, optional: false]}]},
"meck": {:hex, :meck, "0.8.3", "4628a1334c69610c5bd558b04dc78d723d8ec5445c123856de34c77f462b5ee5", [:rebar], []},
"mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], []},
"msgpack": {:git, "https://github.com/msgpack/msgpack-erlang.git", "e84e60dbfff3472f93205415b63e4787bc293d3e", [tag: "0.3.4"]},
"parse_trans": {:git, "git://github.com/uwiger/parse_trans.git", "a210adafdfbb904d156d8f22abd5fb58fc17de1e", [tag: "2.9.2"]},
"ranch": {:hex, :ranch, "1.1.0"},
"ranch": {:hex, :ranch, "1.1.0", "f7ed6d97db8c2a27cca85cacbd543558001fc5a355e93a7bff1e9a9065a8545b", [:make], []},
"setup": {:git, "git://github.com/uwiger/setup.git", "85447ca5eb671db0517a475791ac7fb3604bf44d", [tag: "1.5"]},
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.5"},
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.5", "2e73e068cd6393526f9fa6d399353d7c9477d6886ba005f323b592d389fb47be", [:make], []},
"yang": {:git, "https://github.com/travelping/yang.git", "922128924e7e62115ea7b36d8064b524e27e6615", [branch: "master"]}}
29 changes: 19 additions & 10 deletions rebar.config.script
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
%% -*- erlang -*-
YangPlugin = {plugins, [{rebar3_yang_plugin, {git, "git://github.com/surik/rebar3_yang_plugin.git", {branch, "master"}}}]},
R3Plugins = {plugins, [{rebar3_yang_plugin, {git, "git://github.com/surik/rebar3_yang_plugin.git", {branch, "master"}}},
{coveralls, {git, "git://github.com/markusn/coveralls-erl.git", {branch, "master"}}}
]},
PCPlugin = [{plugins, [pc]}, {provider_hooks, [ {post, [ {compile, {pc, compile}}, {clean, {pc, clean}} ] }] }],
AbnfcPlugin = [{plugins, [ {rebar3_abnfc_plugin, {git, "git://github.com/surik/rebar3_abnfc_plugin.git", {branch, "master"}}} ]},
AbnfcPlugin = [{plugins, [rebar3_abnfc_plugin]},
{provider_hooks, [ {pre, [ {compile, {abnfc, compile}} ] }] }],

HexDeps = [lager, cowboy, hackney, jsx, meck],
HexDeps = [{lager, "2.1.1"}, cowboy, hackney, jsx, {meck, "0.8.3"}],

OverrideYang = {override, yang, PCPlugin},
OverrideDnssd = {override, dnssd, PCPlugin},
OverrideExUri = {override, ex_uri, AbnfcPlugin},
Overrides = {overrides, [OverrideYang, OverrideDnssd, OverrideExUri]},

JobId = os:getenv("TRAVIS_JOB_ID"),
CONFIG0 = lists:keystore(coveralls_service_job_id, 1, CONFIG, {coveralls_service_job_id, JobId}),

code:is_loaded(rebar3) =:= false andalso code:load_file(rebar3),
case erlang:function_exported(rebar3, version, 0) of
true ->
CONFIG1 = lists:keyreplace(plugins, 1, CONFIG, YangPlugin),
CONFIG1 = lists:keyreplace(plugins, 1, CONFIG0, R3Plugins),
NewDeps = lists:foldl(fun(Dep, Deps) ->
Key = case Dep of {K, _} -> K; K -> K end,
[Dep | lists:keydelete(K, 1, Deps)]
end, proplists:get_value(deps, CONFIG1), HexDeps),
CONFIG2 = lists:keyreplace(deps, 1, CONFIG1, {deps, NewDeps}),
CONFIG2 ++ [ {provider_hooks, [{pre, [ {ct, {yang, compile}} ]} ]}] ++ [Overrides];
CONFIG3 = CONFIG2 ++ [ {provider_hooks, [{pre, [ {ct, {yang, compile}} ]} ]}] ++ [Overrides],
case os:getenv("TRAVIS") of
"true" ->
CONFIG3 ++ [{coveralls_coverdata, "all.coverdata"},
{coveralls_service_name, "travis-ci"}];
_ -> CONFIG3
end;
false ->
case os:getenv("TRAVIS") of
"true" ->
JobId = os:getenv("TRAVIS_JOB_ID"),
CONFIG1 = lists:keystore(coveralls_service_job_id, 1, CONFIG, {coveralls_service_job_id, JobId}),
{value, {plugins, Plugins}} = lists:keysearch(plugins, 1, CONFIG1),
lists:keystore(plugins, 1, CONFIG1, {plugins, Plugins ++ [rebar_coveralls]})
++ [{coveralls_coverdata, "logs/all.coverdata"},
{value, {plugins, Plugins}} = lists:keysearch(plugins, 1, CONFIG0),
lists:keystore(plugins, 1, CONFIG0, {plugins, Plugins ++ [rebar_coveralls]})
++ [{coveralls_coverdata, "all.coverdata"},
{coveralls_service_name, "travis-ci"},
{plugin_dir, "deps/coveralls/src"}];
_ -> CONFIG
Expand Down

0 comments on commit 07cfc37

Please sign in to comment.