Skip to content

Commit

Permalink
ci-couch: Travis plays with bunny, now on the sofa
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp committed Apr 14, 2016
1 parent 011afd1 commit 408d930
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sudo: false

services:
- rabbitmq
# - couchdb
- couchdb

addons:
apt:
Expand All @@ -41,7 +41,7 @@ after_success:
- files="$(git diff --name-only master... -- application/ core/)" || true && echo $files
- make build-plt
- ./scripts/check-dialyzer.escript .kazoo.plt $files
- make build-release
- make build-ci-release
- # ERL_LIBS="$HOME/proper" ERLC_OPTS='-DPROPER' make compile-test
- # ERL_LIBS="$HOME/proper" make eunit
- make compile-test
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ELVIS = $(ROOT)/utils/elvis/elvis

KAZOODIRS = core/Makefile applications/Makefile

.PHONY: $(KAZOODIRS) deps core apps xref xref_release dialyze dialyze-apps dialyze-core dialyze-kazoo clean clean-test clean-release build-release tar-release release read-release-cookie elvis
.PHONY: $(KAZOODIRS) deps core apps xref xref_release dialyze dialyze-apps dialyze-core dialyze-kazoo clean clean-test clean-release build-release build-ci-release tar-release release read-release-cookie elvis

all: compile rel/dev-vm.args

Expand Down Expand Up @@ -74,6 +74,8 @@ clean-release:

build-release: clean-release rel/relx.config rel/vm.args
$(RELX) --config rel/relx.config -V 2 release --relname 'kazoo'
build-ci-release: clean-release rel/relx.config rel/vm.args
$(RELX) --config rel/relx.config -V 2 release --relname 'kazoo' --sys_config rel/ci-sys.config
tar-release: rel/relx.config rel/vm.args
$(RELX) --config rel/relx.config -V 2 release tar --relname 'kazoo'
rel/relx.config: rel/relx.config.src
Expand Down
2 changes: 1 addition & 1 deletion core/whistle_config/priv/read-cookie.escript
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

main(_) ->
"-name "++Release = os:getenv("KZname"),
REL = list_to_atom(Release),
REL = list_to_atom(lists:takewhile(fun ($@) -> 'false'; (_) -> 'true' end, Release)),
INI = whistle_config_init:load_file(),
{_, RelEnv} = lists:keyfind(REL, 1, INI),
{_, Cookie} = lists:keyfind('cookie', 1, RelEnv),
Expand Down
2 changes: 1 addition & 1 deletion rel/args
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-setcookie Zhcu56UYhLBWiHmre0aWQngSZcsHqSxqKGIzgE5VU6qLSibqcdqbst84IKxXPxfd
-setcookie change_me

# Tell SASL not to log progress reports, and log SASL errors to a file
-sasl errlog_type error
Expand Down
17 changes: 17 additions & 0 deletions rel/ci-sys.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[ {lager, [ {handlers, [ {lager_console_backend, [ debug
, {lager_kazoo_formatter, [ date, " ", time
, color
, " [", severity ,"] ", "|"
, {function, <<"0000000000">>}, "|"
, module, ":", line
, " (", pid , ") "
, message
, "\e[0m"
, "\r\n"
]}
]}
]}
, {colored, true}
, {error_logger_hwm, 500}
]}
].
20 changes: 11 additions & 9 deletions scripts/check-release-startup.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#!/bin/bash -x

runtime0=10 # seconds
runtime1=11 # seconds
runtime2=12 # seconds
rel=${REL:-whistle_apps} # whistle_apps | ecallmgr | ...
#!/bin/bash

[[ ! -d _rel ]] && echo 'Cannot find _rel/ Is the release built?' && exit -1

echo 'Checking the startup of the release...'

sleep $runtime0 && ACT=stop REL=$rel make release &
sleep $runtime1 && ACT=stop REL=$rel make release &
sleep $runtime2 && ACT=stop REL=$rel make release &
rel=${REL:-whistle_apps} # whistle_apps | ecallmgr | ...
[[ $rel != *@* ]] && rel=$rel@127.0.0.1

[[ $rel != whistle_apps* ]] && export KAZOO_APPS='ecallmgr'

function stop() {
erl -noshell -setcookie change_me -name stopper@${rel##*@} -eval "ok = rpc:call('$rel', init, stop, [])." -s init stop
}

sleep 180 && stop &

REL=$rel make release

0 comments on commit 408d930

Please sign in to comment.