forked from CenterForOpenScience/osf.io
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
104 lines (84 loc) · 3.12 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
# 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:
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
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 &
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
before_script:
- flake8 .
- jshint website/static/js
# Run Python tests (core and addon) and JS tests
script:
- invoke test --all
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