forked from ospc-org/ospc.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (40 loc) · 1.55 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
matrix:
include:
- language: ruby # Cannot be 'minimal' in order to have PostgreSQL
sudo: required
services: docker
env: TAG=${TRAVIS_COMMIT::6}
# Need NEW_RELIC_TOKEN to be defined in Travis settings
install:
- make NEW_RELIC_TOKEN=$NEW_RELIC_TOKEN webapp-build
- pip install --user git-lint pylint pycodestyle
- export PATH=$PATH:/$HOME/.local/bin
addons:
postgresql: "9.4"
before_script: psql -c 'create database mypb;' -U postgres
script:
- >
docker run --net host -e PORT=80 -e DJANGO_SETTINGS_MODULE=webapp.settings
-e DROPQ_WORKERS=127.0.0.1:5050
-e DATABASE_URL=postgresql://postgres@localhost/mypb
-it opensourcepolicycenter/web:$TAG
/bin/bash -c "pip install -q pytest-django && py.test webapp/apps"
- if git reset --soft ${TRAVIS_COMMIT_RANGE%...*}; then git lint; fi
deploy:
provider: script
# Need HEROKU_TOKEN to be defined in Travis settings
script: docker login --username=_ --password=$HEROKU_TOKEN registry.heroku.com && make MODE=test webapp-release
on:
branch: master
- language: minimal
sudo: required
services: docker
# Also need OSPC_ANACONDA_TOKEN, AWS_ACCOUNT_ID, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to be defined in settings
env: TAG=${TRAVIS_COMMIT::6}
install: make OSPC_ANACONDA_TOKEN=$OSPC_ANACONDA_TOKEN dist-build
script: make dist-test
deploy:
provider: script
script: bash distributed/deploy.sh staging
on:
branch: master