forked from CenterForOpenScience/osf.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
133 lines (111 loc) · 4.36 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Config file for automatic testing at travis-ci.org
language: python
python:
- "2.7"
sudo: false
cache:
directories:
- $HOME/.cache
- node_modules
- website/static/vendor/bower_components
env:
global:
- PROJECT_DIR="$PWD"
- WHEELHOUSE="$HOME/.cache/wheelhouse"
- TOKU_HUGE_PAGES_OK=1
- TOKUMX_ARCHIVE="tokumx-2.0.0-linux-x86_64-main.tar.gz"
- ELASTICSEARCH_ARCHIVE="elasticsearch-1.5.0.tar.gz"
- LIBJEMALLOC_DEB="libjemalloc1_3.5.1-2_amd64.deb"
- LIBPCRE_DEB="libpcre3_8.31-2ubuntu2.1_amd64.deb"
- VARNISH_DEB="varnish_4.1.0-1~trusty_amd64.deb"
matrix:
- TEST_BUILD="osf"
- TEST_BUILD="else"
- TEST_BUILD="varnish"
before_install:
# cache directories
- |
mkdir -p $HOME/.cache/downloads
mkdir -p $HOME/.cache/pip
mkdir -p $HOME/.cache/wheelhouse
# tokumx
- |
cd $HOME/.cache/downloads
if [ ! -f "$TOKUMX_ARCHIVE" ]; then
curl -SLO https://s3.amazonaws.com/tokumx-2.0.0/$TOKUMX_ARCHIVE
fi
if [ ! -f "$TOKUMX_ARCHIVE.md5" ]; then
curl -SLO https://s3.amazonaws.com/tokumx-2.0.0/$TOKUMX_ARCHIVE.md5
fi
md5sum --check $TOKUMX_ARCHIVE.md5
mkdir -p /tmp/tokumx/data
tar xzf $TOKUMX_ARCHIVE -C /tmp/tokumx --strip-components=1
- /tmp/tokumx/bin/mongod --dbpath=/tmp/tokumx/data > /dev/null &
# elasticsearch
- |
cd $HOME/.cache/downloads
if [ ! -f "$ELASTICSEARCH_ARCHIVE" ]; then
curl -SLO https://download.elasticsearch.org/elasticsearch/elasticsearch/$ELASTICSEARCH_ARCHIVE
fi
if [ ! -f "$ELASTICSEARCH_ARCHIVE.sha1.txt" ]; then
curl -SLO https://download.elasticsearch.org/elasticsearch/elasticsearch/$ELASTICSEARCH_ARCHIVE.sha1.txt
fi
sha1sum --check $ELASTICSEARCH_ARCHIVE.sha1.txt
mkdir -p /tmp/elasticsearch
tar xzf $ELASTICSEARCH_ARCHIVE -C /tmp/elasticsearch --strip-components=1
- /tmp/elasticsearch/bin/elasticsearch > /dev/null &
# varnish
- |
cd $HOME/.cache/downloads
if [ ! -f "$LIBJEMALLOC_DEB" ]; then
curl -SLO http://mirrors.kernel.org/ubuntu/pool/universe/j/jemalloc/$LIBJEMALLOC_DEB
fi
if [ ! -f "$LIBPCRE_DEB" ]; then
curl -SLO http://security.ubuntu.com/ubuntu/pool/main/p/pcre3/$LIBPCRE_DEB
fi
if [ ! -f "$VARNISH_DEB" ]; then
curl -SLO https://repo.varnish-cache.org/ubuntu/pool/varnish-4.1/v/varnish/$VARNISH_DEB
fi
dpkg -x $LIBJEMALLOC_DEB /tmp/libjemalloc
dpkg -x $LIBPCRE_DEB /tmp/libpcre
dpkg -x $VARNISH_DEB /tmp/varnish
- |
export LD_LIBRARY_PATH=/tmp/libpcre/lib/x86_64-linux-gnu:/tmp/libjemalloc/usr/lib/x86_64-linux-gnu:/tmp/varnish/usr/lib/varnish
/tmp/varnish/usr/sbin/varnishd -n /tmp -p feature=+esi_disable_xml_check -p vmod_dir=/tmp/varnish/usr/lib/varnish/vmods -F -f $PROJECT_DIR/tests/test_files/varnish.vcl -a *:8080 > /dev/null &
- |
if [ "$TEST_BUILD" = "varnish" ]; then
export ENABLE_VARNISH=True
fi
install:
- cd $PROJECT_DIR
- cp website/settings/local-travis.py website/settings/local.py
- cp api/base/settings/local-dist.py api/base/settings/local.py
# - travis_retry invoke encryption
- travis_retry pip install --upgrade pip
- travis_retry pip install invoke==0.9.0
- travis_retry pip install flake8==2.4.0 --force-reinstall --upgrade
- travis_retry npm install jshint
- travis_retry invoke wheelhouse --dev --addons
- travis_retry invoke travis_addon_settings
- travis_retry invoke requirements --dev --addons
# Hack to fix package conflict between uritemplate and uritemplate.py (dependency of github3.py)
- pip uninstall uritemplate.py --yes
- pip install uritemplate.py==0.3.0
- travis_retry invoke assets --dev
# Run Python tests (core and addon) and JS tests
script:
- invoke test_travis_$TEST_BUILD
before_cache:
- rm -Rf $HOME/.cache/pip/http
- rm -f $HOME/.cache/pip/log/debug.log
# exclude python requirements from github repo's
- rm -f $HOME/.cache/wheelhouse/modular_odm-*.whl
- rm -f $HOME/.cache/wheelhouse/mfr-*.whl
- rm -f $HOME/.cache/wheelhouse/httpretty-*.whl
- rm -f $HOME/.cache/wheelhouse/mendeley-*.whl
- rm -f $HOME/.cache/wheelhouse/feedparser-*.whl
# exclude npm from github repo's
- rm -Rf node_modules/dropzone
- rm -Rf node_modules/treebeard
notifications:
flowdock: 0221882cdda034c0e9ac2a0e766053dd