forked from DataScienceDiscord/Charlotte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (48 loc) · 1.37 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
addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10
env:
global:
- PGPORT=5433
- ENVCHARLOTTE=TEST
services:
- postgresql
language: python
python:
- "3.6"
before_install:
- sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
- sudo service postgresql restart
- sleep 1
- pip install --upgrade pip
install:
- pip install -r requirements.txt
before_script:
- touch .database_secret
- psql -c 'create database charlotte_test;' -U postgres
- python -m scripts.init_tables
script:
- pytest
- sphinx-apidoc -o docs/source/_generated . tests/* main.py -e -f
- make -C docs html
- pytest --cov=. tests/ --cov-config .coveragerc --cov-report=
- coveralls
deploy:
provider: pages
skip-cleanup: true
keep-history: true
github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
local-dir: docs/build/html
repo: DataScienceDiscord/Charlotte-Documentation
on:
branch: master
after_success:
- if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then
eval "$(ssh-agent -s)";
echo -e $SSH_KEY > /tmp/.id_travis;
chmod 600 /tmp/.id_travis;
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /tmp/.id_travis $LIGHTSAIL_USER@$IP -p $PORT -C "./deploy.sh";
fi