forked from allegro/ralph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
95 lines (83 loc) · 3.33 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
language: python
env:
global:
- DATABASE_USER=travis
- DATABASE_PASSWORD=travis
- DJANGO_CURRENT_VERSION=1.8.17
- RALPH2_RALPH3_CROSS_VALIDATION_ENABLED=1
- REDIS_PORT=6379
- DATABASE_PORT=5433
matrix:
- DJANGO_VERSION=1.8.17 TEST_DB_ENGINE=mysql MYSQL_VERSION=5.6
- DJANGO_VERSION=1.8.17 TEST_DB_ENGINE=mysql MYSQL_VERSION=5.5
- DJANGO_VERSION=1.8.17 TEST_DB_ENGINE=psql
# Django 1.9 build will not pass until #2132 will be merged
# - DJANGO_VERSION=1.9 TEST_DB_ENGINE=sqlite
# - DJANGO_VERSION=1.9 TEST_DB_ENGINE=mysql
# - DJANGO_VERSION=1.9 TEST_DB_ENGINE=psql
# matrix:
# allow_failures:
# - env: DJANGO_VERSION=1.9 TEST_DB_ENGINE=mysql
# - env: DJANGO_VERSION=1.9 TEST_DB_ENGINE=sqlite
# - env: DJANGO_VERSION=1.9 TEST_DB_ENGINE=psql
services:
- docker
cache:
directories:
- node_modules
- bower_components
python:
- "3.4"
# - "3.5" # temporary removed to speedup biuld (python3.4 should be now used on production)
before_install:
- pip install flake8==3.0.4 isort
- make flake
- npm install -g gulp
- export RALPH_VERSION=$(cat VERSION)
- docker run -d -p "$REDIS_PORT:6379" redis:3.0;
- export NEW_TAG=$RALPH_VERSION-snapshot-$(date "+%Y%m%d")-$TRAVIS_BUILD_NUMBER
- if [[ $TEST_DB_ENGINE == mysql ]]; then docker run -d -v $(pwd)/docker/mysql.cnf:/etc/mysql/conf.d/mysql.cnf -p "$DATABASE_PORT:3306" -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" -e "MYSQL_DATABASE=ralph_ng" -e "MYSQL_ROOT_PASSWORD=root" -e "MYSQL_USER=travis" -e "MYSQL_PASSWORD=travis" mysql:$MYSQL_VERSION; fi
- if [[ $TEST_DB_ENGINE == psql ]]; then
docker run -d -p "$DATABASE_PORT:5432" -e "POSTGRES_USER=travis" -e "POSTGRES_PASSWORD=travis" -e "POSTGRES_DB=ralph_ng" postgres:9.4;
pip install psycopg2;
fi
install:
- npm config set python /usr/bin/python2.7
- npm install
- make js-hint
- gulp
- make install-test
- pip install coveralls
- pip install django==$DJANGO_VERSION
script:
- python contrib/dhcp_agent/test.py
- ./scripts/test_settings.sh prod test >/dev/null
- make coveralls
- ./scripts/check_missing_migrations.sh
after_success:
- if [[ $TEST_DB_ENGINE == psql ]]; then coveralls; fi
before_deploy:
- sudo add-apt-repository -y ppa:spotify-jyrki/dh-virtualenv
- sudo apt-get update
- sudo apt-get install -y devscripts python-virtualenv git equivs dh-virtualenv libmysqlclient-dev python3-dev libffi-dev nodejs nodejs-legacy
- make build-package
deploy:
- provider: script
script: scripts/travis_deploy_docker.sh
on:
branch: ng
python: 3.4
condition: $TRAVIS_EVENT_TYPE = cron && $TEST_DB_ENGINE = psql && $DJANGO_VERSION = $DJANGO_CURRENT_VERSION
- provider: script
script: scripts/travis_deploy_bintray.sh
on:
branch: ng
python: 3.4
condition: $TRAVIS_EVENT_TYPE = cron && $TEST_DB_ENGINE = psql && $DJANGO_VERSION = $DJANGO_CURRENT_VERSION
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/837fe61b536818b676ad
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false