-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
61 lines (55 loc) · 1.84 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
sudo: required
dist: trusty # google-cloud-engine mod of ubuntu 14.04.3 LTS
language: python
python:
- "3.5"
# if specific versions of docker or docker-compose are needed, see travis-CI docs
services:
- docker # default is docker 1.8.2 and docker-compose 1.4.2 (as of Oct. 2016)
notifications:
slack: cs4501-isa:V5a4ZkpLY6CpfiQa26kNCgb4
install: # prepare mySQL database
- docker pull mysql:5.7.14
- mkdir db
- >
docker run --name mysql -d -e MYSQL_ROOT_PASSWORD='$3cureUS'
-v `pwd`/db:/var/lib/mysql mysql:5.7.14
- sleep 15 # need to give time for mysql to start
- >
docker run -it --name mysql-cmd --rm --link mysql:db mysql:5.7.14
mysql -uroot -p'$3cureUS' -h db -v -e
"CREATE DATABASE cs4501 CHARACTER SET utf8;
CREATE DATABASE test_cs4501 CHARACTER SET utf8;
CREATE USER 'www'@'%' IDENTIFIED BY '\$3cureUS';
GRANT ALL PRIVILEGES ON *.* TO 'www'@'%';"
- sudo pip install coveralls
before_script:
- docker-compose up -d
- sleep 45
script:
# using first instance of each app server
- >
docker exec -it models0 bash -c
"pip install -r requirements.txt &&
pip install coveralls &&
python manage.py test --noinput && cat .coverage && coverage report" # run Django unit tests on models
- >
docker exec -it exp0 bash -c
"pip install -r requirements.txt &&
python manage.py test --noinput" # run Django unit tests on experience layer
- >
docker exec -it web0 bash -c
"pip install -r requirements.txt &&
python manage.py test --noinput" # run Django integration tests on web front-end
after_success:
- cat models/.coverage
- sed -i "s/\/app/models/g" models/.coverage
- mv models/.coverage .
- cat .coverage
- coveralls -v
after_script:
- docker-compose stop
- docker stop mysql
- docker rm `docker ps -aq`
- docker rmi `docker images -q`
- sudo rm -rf *