forked from catmaid/CATMAID
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
75 lines (75 loc) · 3.13 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
notifications:
email: false
language: python
python:
- "2.7"
env:
global:
- SLIMERJSLAUNCHER=$(which firefox) DISPLAY=:99.0 PATH=$TRAVIS_BUILD_DIR/slimerjs:$PATH TMPDIR=$TRAVIS_BUILD_DIR/tmp
- GH_REF: github.com/catmaid/catmaid.github.io.git
- secure: "jS17W1CVlSIcUl0BqQjWpDlncxvOFg3w6HDOCuCp0DlPjMaJcLK3xjPqKE3a4FbTvTWo/q8jxjk4lGkRa5GneZhk/b0UEpQBrfY6NmQF4df0MHA7rRdLoSYAqh96bMKWLWSZ/teEB89wUxX21Zyuft05IvJ0G1s4PazTrZoovcg="
addons:
firefox: "38.0"
postgresql: 9.3
before_install:
- mkdir tmp
- travis_retry sudo apt-get update -y -qq
- sh -e /etc/init.d/xvfb start
install:
- travis_retry sudo apt-get install -y -qq $(< packagelist-ubuntu-12.04-apt.txt)
- travis_retry python -m pip install -U pip
- travis_retry travis_wait 60 pip install -q -r django/requirements.txt
- pip list
# Install additional dependencies for Travis
- pip install coveralls
- npm install jshint qunit-phantomjs-runner csslint
before_script:
- psql -c 'CREATE DATABASE catmaid;' -U postgres
- psql -c 'CREATE EXTENSION postgis;' -U postgres catmaid
- cd django
- cp configuration.py.example configuration.py
- sed -i -e "s?^\(abs_catmaid_path = \).*?\1'$(pwd)'?g" configuration.py
- sed -i -e "s?^\(abs_virtualenv_python_library_path = \).*?\1'$(echo $VIRTUAL_ENV)'?g" configuration.py
- sed -i -e "s?^\(catmaid_database_name = \).*?\1'catmaid'?g" configuration.py
- sed -i -e "s?^\(catmaid_database_username = \).*?\1'postgres'?g" configuration.py
- sed -i -e "s?^\(catmaid_timezone = \).*?\1'America/New_York'?g" configuration.py
- sed -i -e "s?^\(catmaid_servername = \).*?\1'localhost:8000'?g" configuration.py
- cat configuration.py
- python create_configuration.py
- sed -i -e "s?^\(ALLOWED_HOSTS = \).*?\1['*']?g" projects/mysite/settings.py
- cat projects/mysite/settings.py
- cd ..
script:
- jshint --config=.travis.jshintrc --exclude-path=.travis.jshintignore django/applications
- cd django/applications/catmaid/static/css
- $TRAVIS_BUILD_DIR/node_modules/.bin/csslint .
- cd $TRAVIS_BUILD_DIR
- cd django/projects/mysite
- python manage.py syncdb --migrate --noinput
- python manage.py collectstatic --link --noinput
- coverage run manage.py test catmaid.tests
# Remove login requirement from QUnit test page
- sed -i 's/login_required(\([^)]*\))/\1/g' ../../applications/catmaid/urls.py
- python manage.py runserver &
- sleep 5
- cd ../../..
# Run QUnit tests through SlimerJS with Firefox
- wget http://download.slimerjs.org/releases/0.9.6/slimerjs-0.9.6.zip
- unzip slimerjs-0.9.6.zip
- mv slimerjs-0.9.6 ./slimerjs
- ./.travis-run-slimerjs.sh http://localhost:8000/tests
after_success:
- cd django/projects/mysite && coveralls
# Build documentation
- cd ../../../sphinx-doc
- make html
# Push to GitHub pages
- git clone "https://${GH_REF}" build/catmaid.github.io
- cd build/catmaid.github.io
- git rm -r dev
- mv ../html dev
- git add dev
- git config --global user.email "[email protected]"
- git config --global user.name "Tracis CI"
- git commit -m "Compile new version of documentation"
- git push --quiet "https://${GH_TOKEN}@${GH_REF}" master:master > /dev/null