-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathci
executable file
·61 lines (59 loc) · 3.15 KB
/
ci
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
#!/bin/bash
set -ev # Ref https://docs.travis-ci.com/user/customizing-the-build/#Implementing-Complex-Build-Steps
case "${1:?}"-"${2:?}" in
before_install-*)
## Travis CI does not support rebar3 yet. See https://github.com/travis-ci/travis-ci/issues/6506#issuecomment-275189490
BuildDir="${3:?}"
curl -fL -o "${BuildDir:?}"/rebar3 https://github.com/erlang/rebar3/releases/download/3.4.2/rebar3
chmod +x "${BuildDir:?}"/rebar3
;;
install-dialyzer)
BuildDir="${3:?}"
( cd "${BuildDir:?}" && ./rebar3 tree; )
( cd "${BuildDir:?}" && ./rebar3 dialyzer -u true -s false; )
;;
install-smokeloadtest)
BuildDir="${3:?}"
WorkDir="${BuildDir:?}"/tmp
mkdir "${WorkDir:?}" ## create working folder
( cd "${WorkDir:?}" && git clone https://github.com/mrallen1/basho_bench.git && cd basho_bench && git checkout c92c71c09b17f5f2c983a31d2a6ec2db40de9bfe && PATH="${BuildDir:?}":"$PATH" make && file basho_bench; ) ## build load test tool "basho_bench"
mkdir "${WorkDir:?}"/R_libs ## create location for R libraries used by graph generation in basho_bench
;;
install-*)
true
;;
before_script-eunit)
BuildDir="${3:?}"
mkdir "${BuildDir:?}"/data
;;
before_script-smokeloadtest)
BuildDir="${3:?}"
WorkDir="${BuildDir:?}"/tmp
( cd "${BuildDir:?}" && ./rebar3 compile && ls "${BuildDir:?}"/_build/default/lib; ) ## compile trie library
mkdir "${WorkDir:?}"/ebin ## create location for trie library-specific module for basho_bench
mkdir "${WorkDir:?}"/basho_bench/data ## create location for data persisted by trie library
;;
before_script-*)
true
;;
script-eunit)
BuildDir="${3:?}"
( cd "${BuildDir:?}" && ./rebar3 eunit && ./rebar3 proper; )
;;
script-dialyzer)
BuildDir="${3:?}"
( cd "${BuildDir:?}" && ./rebar3 dialyzer; )
;;
script-xref)
BuildDir="${3:?}"
( cd "${BuildDir:?}" && ./rebar3 xref; )
;;
script-smokeloadtest)
BuildDir="${3:?}"
WorkDir="${BuildDir:?}"/tmp
erlc -o "${WorkDir:?}"/ebin "${BuildDir:?}"/scripts/load_test/basho_bench_driver_trie.erl && file "${WorkDir:?}"/ebin/basho_bench_driver_trie.beam ## compile trie library-specific module for basho_bench
sed -e "s|CODE_PATHS_AS_STRING_LIST|[\"${WorkDir:?}/ebin\", \"${BuildDir:?}/_build/default/lib/dump/ebin\", \"${BuildDir:?}/_build/default/lib/encrypter/ebin\", \"${BuildDir:?}/_build/default/lib/pink_hash/ebin\", \"${BuildDir:?}/_build/default/lib/trie/ebin\"]|" < "${BuildDir:?}"/scripts/load_test/trie.config.template > "${WorkDir:?}"/trie.config && cat "${WorkDir:?}"/trie.config ## instantiate load test configuration and show it
( cd "${WorkDir:?}"/basho_bench && ./basho_bench --results-dir ./tests "${WorkDir:?}"/trie.config; ) ## run load test
( cd "${WorkDir:?}"/basho_bench && ( R_LIBS="${WorkDir:?}"/R_libs && export R_LIBS && make results; ) && ( cd ./tests/current && ls -l; ) && file ./tests/current/summary.png; ) ## generate load test results graph
;;
esac