forked from refinery-platform/refinery-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
111 lines (93 loc) · 3.67 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
sudo: required
language: python
addons:
apt:
packages:
- xvfb
cache:
directories:
- /home/travis/.cache/pip
- /home/travis/.cypress/Cypress
python:
- 2.7
services:
- postgresql
- neo4j
- docker
install:
- node --version
- NODE_VERSION=6.11.0
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
- node --version
- npm --version
- npm install -g [email protected]
- npm --version
- pip install -r requirements.txt --quiet
# Firefox could be downloaded more simply as a Travis addon...
# but the progress meter adds 1000 lines to the log.
- FIREFOX_SOURCE_URL='https://download.mozilla.org/?product=firefox-53.0.3&lang=en-US&os=linux64'
- wget --no-verbose -O /tmp/firefox-53.0.3.tar.bz2 $FIREFOX_SOURCE_URL
- export PATH=$HOME/firefox-53.0.3/firefox:$PATH
- firefox --version
# Install geckodriver required for selenium testing
- GECKODRIVER_VERSION=v0.17.0
- TAR=geckodriver-$GECKODRIVER_VERSION-linux64.tar
- wget --no-verbose https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/$TAR.gz
- gunzip $TAR.gz
- tar -xvf $TAR
- chmod a+x geckodriver
- export PATH=$PATH:`pwd`
env:
global:
# These env vars are available to every build
- PYTHONPATH=$PYTHONPATH:../refinery:../refinery/config
- DJANGO_SETTINGS_MODULE=config.settings.prod
# CYPRESS_RECORD_KEY:
- secure: oGdTYh3rnPdG7qVGYq3TgVESypir1btO2kmafumtKR6o+FYmMtb09pe+HtiT6Qfv4pDwnYZ2RTYqsTY4h6POigU5j7qQPSsZ5WkhHt9ybFyt/vfo2B95GaAIFt+8LVjTX5TItyw0/PPUCCUluQ1n8k/NCtSfMb0kIT/CuLrg7N8=
before_script:
# Vagrant is not used on travis: This user is just for the database.
- createuser --createdb --no-superuser --no-createrole vagrant
- createdb -O vagrant refinery
- sudo mkdir /data # In vagrant, this is created by puppet; In production, this is an EBS mount.
- sudo chown $USER /data
- cd refinery
# See http://www.stuartellis.eu/articles/erb/#running-erb-from-the-command-line
- erb config/config.json.erb > config/config.json
- python manage.py migrate --noinput
- npm install -g [email protected] [email protected] --progress false --quiet || ( cat npm-debug.log && false )
- cd ui
- npm install --progress false --quiet || ( cat npm-debug.log && false )
- bower install --config.interactive=false --quiet
- cd ../
# Required for cypress tests; TODO: Move to puppet.
# TODO: Start up solr (and neo4j?)
- python manage.py loaddata guest.json
- python manage.py activate_user guest
- python manage.py add_users_to_public_group
- pushd ui && grunt make && popd
- python manage.py collectstatic --noinput -v 0
- python manage.py runserver --insecure --settings config.settings.dev 2>&1 | grep -v 200 &
script:
- set -e # Any error will cause travis to exit early and report a failure.
# TODO: Not the same behavior as pre-commit hook.
# https://github.com/refinery-platform/refinery-platform/issues/1851
- flake8 --exclude=migrations,ui ..
- echo 'travis_fold:start:grunt'
- pushd ui && grunt test && popd
- echo 'travis_fold:end:grunt'
- echo 'travis_fold:start:django-tests'
- coverage run manage.py test
- echo 'travis_fold:end:django-tests'
- echo 'travis_fold:start:cypress'
- pushd ui && node_modules/.bin/cypress run --record && popd
- echo 'travis_fold:end:cypress'
- set +e # Currently, codecov does not always exit with 0, but that should not cause travis to fail.
after_success:
- echo 'travis_fold:start:codecov'
- codecov
- npm run codecov
- echo 'travis_fold:end:codecov'
notifications:
slack:
secure: nDs9Oj08nRizuD0edl6WcrSgaTPMyITQjZc4qPZpt+yOxUehWbrAmVhqYypfyvdj4qSi1E72rPTXftuBB1E1IZBgX4CCkrCkWGLgIxHaaValTd64oOX66eC3BbSehQxuJB7w1DWw54xBUkTy6+ufjAqiwhLpoEUeE296urAWYHU=