-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
64 lines (64 loc) · 2.58 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
sudo: true
language: python
python:
- "3.6"
addons:
ssh_known_hosts:
- 104.236.68.6
- 159.203.182.32
env:
global:
- CC_TEST_REPORTER_ID=bf64f4cd10722061b8cad12ca638ebfa7d3c1494df117613b2acd357bfd7aeb0
notifications:
slack:
rooms:
- epsmds:XuAMBzep3dPckHegAe6quxOm#github
services:
- docker
before_install:
- sudo apt-get remove docker docker-engine docker.io
- sudo apt-get update
- sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get install docker-ce
- docker-compose version
- docker version
- sudo apt-get install texlive-latex-base texlive-fonts-recommended -y
- sudo apt-get install texlive-fonts-extra texlive-latex-extra -y
- sudo apt-get install python-sphinx -y
- python3 -m pip install pip -U
- python3 -m pip install mkdocs
before_script:
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' || $TRAVIS_BRANCH == 'develop' ]]; then if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true'; else echo -n 'false'; fi; fi)"
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
- docker-compose -f local.yml pull
- docker-compose -f local.yml up --build -d
script:
- echo $DOCKER_ID_USER_PASSWORD | docker login -u $DOCKER_ID_USER --password-stdin
- docker-compose -f local.yml run --rm django py.test
- docker-compose -f local.yml run --rm django coverage run -m py.test
- docker-compose -f local.yml run --rm django coverage xml
deploy:
# deploy develop to the staging environment
- provider: script
script: bash staging-deploy.sh
skip_cleanup: true
on:
branch: develop
# deploy master to production
- provider: script
script: bash production-deploy.sh
skip_cleanup: true
on:
branch: master
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -t coverage.py
- make -C docs/ latexpdf
- mv docs/_build/latex/drdown.pdf docs/drdown.pdf
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./mkdocs-build.sh ; echo "Completed deploying documentation" ; fi