forked from rabbitmq/rabbitmq-autocluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
107 lines (94 loc) · 3.04 KB
/
.travis.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
language: erlang
otp_release:
- 19.2
- 19.3
addons:
apt:
packages:
- curl
- xsltproc
cache:
apt: true
directories:
- $HOME/.cache/plt
- $HOME/.cache/bin
install:
- export PATH=$PATH:$HOME/.local/bin
before_script:
- git checkout -B "${TRAVIS_TAG:-${TRAVIS_BRANCH}}"
- |
if [ ! -e $HOME/.cache/bin/etcd ]; then
mkdir -p $HOME/.cache/bin
(set -e
cd $HOME/.cache/bin
curl -L https://github.com/coreos/etcd/releases/download/v2.3.7/etcd-v2.3.7-linux-amd64.tar.gz -o etcd.tar.gz
tar -xz --strip-components=1 -f etcd.tar.gz
)
fi
export USE_ETCD=$HOME/.cache/bin/etcd
script:
- make RABBITMQ_CURRENT_FETCH_URL=https://github.com/rabbitmq/rabbitmq-trick-erlang.mk-into-using-proper-url-for-deps
- |
set -exo pipefail
function ensure_plt() {
# We want this to happen after ct run, so `rabbit` dependency will be fetched.
# Then we can add rabbit/rabbit_common to plt, thus getting 0
# warnings after running dialyzer itself
# Try to use cached plt if it's valid
if [ -r $HOME/.cache/plt/.autocluster.plt ]; then
cp -va $HOME/.cache/plt/.autocluster.plt .
# Cached PLT can become invalid (i.e. reference some renamed/deleted .beam)
dialyzer --check_plt --plt ./.autocluster.plt || rm -f ./.autocluster.plt
fi
# Build PLT from scratch if there is no cached copy
if [ ! -f ./.autocluster.plt ]; then
make plt || true # making plt produces some warnings which we don't care about
mkdir -p $HOME/.cache/plt/
cp -va .autocluster.plt $HOME/.cache/plt/
fi
}
function upload_logs() {
tar cjvf logs.tar.bz2 logs/
echo Uploading logs for further investigation to:
curl -sST logs.tar.bz2 chunk.io
}
if [ "$TRAVIS_OTP_RELEASE" == "19.1" ]; then
export PROPER_ONLY=true
else
export PROPER_ONLY=
fi
case "$PROPER_ONLY" in
true)
if ! make test-build ct IS_APP=1 CT_SUITES=etcd; then
upload_logs
exit 1
fi
;;
*)
pip install --user codecov
if ! make test-build ct COVER=true IS_APP=1; then
upload_logs
exit 1
fi
ensure_plt
make dialyze
./bin/covertool -cover ct.coverdata -appname autocluster
codecov -f coverage.xml -X search
;;
esac
set +exo pipefail
before_deploy:
- make clean
- make dist
- tar cvfz autocluster-${TRAVIS_TAG}.tgz plugins/autocluster*.ez plugins/rabbitmq_aws-*.ez
- echo "TRAVIS_OTP_RELEASE = ${TRAVIS_OTP_RELEASE}"
deploy:
provider: releases
api_key:
secure: ktklMK+XMOteFt+m9NHhVqKkA1Wo8f9L/cJphUmBMgb3TS+4+vAU50yY8omIyprS8poc3mBWxjYD9p9xdeDnXY2tiFrLDKCWU/jbH3awD0uL6W0Di8BYAVOGhr2Jjjp6gi/B67wHtCtzEoSSNNfMMZ+RWf4GZjJ96NXOLhPRx4k=
file: autocluster-${TRAVIS_TAG}.tgz
skip_cleanup: true
on:
condition: "$TRAVIS_OTP_RELEASE = 17.5"
tags: true
repo: aweber/rabbitmq-autocluster