forked from zestedesavoir/zds-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
99 lines (83 loc) · 2.89 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
git:
depth: 1
language: python
python:
- 2.7
env:
global:
- secure: "azmDZZQZzf88zpbkYpLpxI66vpEVyv+kniW0QdWAt4qlys8P5OcO3VJBR5YT85vlvnjN9b6raWQAL1ymee0WmVdTmzXed8XjZv7t9QXVw7pfezxMKlEftVp/4Cu4wtvbew0ViZXNWV2hNXHzEqlhgnoIOq94i0UzZ7grMrI0xm0="
matrix:
- TEST_APP="-e back_mysql"
- TEST_APP="-e front"
notifications:
irc:
channels:
- irc.smoothirc.net#zds-dev
skip_join: true
services: mysql
sudo: false
addons:
apt:
packages:
- libmysqlclient-dev
- ttf-mscorefonts-installer
- language-pack-fr
- unzip
before_script:
# configure mysql
- mysql -e "SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES'" # Travis default
# try to avoid mysql has gone away errors
- mysql -e "SET GLOBAL wait_timeout = 36000;"
- mysql -e "SET GLOBAL max_allowed_packet = 134209536;"
- mysql -e "SHOW VARIABLES LIKE 'max_allowed_packet';"
- mysql -e "SHOW VARIABLES LIKE 'wait_timeout';"
# database services
- mysql -e 'create database zds_test;'
- mv zds/settings_test.py zds/settings_prod.py
install:
- |
if [[ "$TEST_APP" == *"back"* ]]
then
./scripts/install_texlive.sh
export PATH=~/.texlive/bin/x86_64-linux:$PATH
fi
- export RESOURCES_URL="http://www.googledrive.com/host/0BzabS14KitJgfmV2ekdWSktmVEpieU93TG11RFNkWlZqS0JwZk93ZGhMR1lCWVg5NzFVc00"
# Add fonts
- mkdir -p ~/.fonts/truetype
- wget -P ~/.fonts/truetype $RESOURCES_URL/Andale-Mono.ttf
- wget -P ~/.fonts/truetype $RESOURCES_URL/Merriweather.zip
- unzip ~/.fonts/truetype/Merriweather.zip -d ~/.fonts/truetype/Merriweather/
- chmod a+r ~/.fonts/truetype/Merriweather/*.ttf
- chmod a+r ~/.fonts/truetype/Andale-Mono.ttf
- fc-cache -f -v
# Cabal + Pandoc stuff
- mkdir -p ~/cabal/bin
- mkdir -p ~/.pandoc
- wget -P ~/cabal/bin $RESOURCES_URL/pandoc
- wget -P ~/.pandoc/templates $RESOURCES_URL/default.epub
- wget -P ~/.pandoc/templates $RESOURCES_URL/default.html
- touch ~/.pandoc/epub.css
- touch ~/.pandoc/templates/epub.css
- chmod u+x,g+x,o+x ~/cabal/bin/pandoc
- export PATH=$PATH:~/cabal/bin
- ~/cabal/bin/pandoc --version
# Python dependencies
- travis_retry pip install coveralls
- travis_retry pip install tox==2.0.1
script:
- tox $TEST_APP
after_success:
- coveralls
- |
COMMIT_MSG=`git rev-list --format=%B --max-count=1 $TRAVIS_COMMIT`
if [[ "$TEST_APP" == *"front"* ]] && [[ "$TRAVIS_PULL_REQUEST" == false ]] && [[ ! -z "$TRAVIS_TAG" ]] && [[ ! "$TRAVIS_TAG" == *"-build" ]]
then
# Adding GitHub OAuth token to login
echo "machine github.com login $GITHUB_TOKEN password x-oauth-basic" > ~/.netrc
git config --global url."https://".insteadOf git://
git config --global user.name "Build bot"
git config --global user.email "[email protected]"
git config --global push.default simple
# Run script
./scripts/push_front.sh $TRAVIS_TAG
fi