-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy path.travis.yml
56 lines (47 loc) · 1.1 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
language: python
python:
- "3.6"
- "3.7"
dist: xenial
# setup environment
env:
global:
- DJANGO_SETTINGS_MODULE='settings'
- DB_HOST=localhost
- DB_PASSWORD=
- DB_NAME=mp
- DB_USER=postgres
- SECRET_KEY=thISkEyisUsedForTravis
- SOLR_URL=http://127.0.0.1:8983/solr/tester
- SOLR_ADMIN_URL=http://127.0.0.1:8983/solr/admin/cores
# install dependencies
install:
- pip install -q -r app/requirements.txt
- pip install codecov
- docker build -t macports-webapp .
- >
docker run -d
--publish 8080:8080
--env DB_HOST=$DB_HOST
--env DB_PASSWORD=$DB_PASSWORD
--env DB_NAME=$DB_NAME
--env DB_USER=$DB_USER
--env SECRET_KEY=$SECRET_KEY
--name=macports-webapp macports-webapp
# run test scripts
script:
- python manage.py migrate --noinput
- python manage.py collectstatic --noinput
- coverage run --source=. manage.py test
- coverage report
- docker ps | grep -q macports-webapp
services:
- postgresql
- docker
before_script:
- psql -c 'create database mp;' -U postgres
- cd app
addons:
postgresql: "10"
after_success:
- codecov