2020-02-05 14:54:13 -05:00
|
|
|
language: python
|
2020-02-05 15:17:47 -05:00
|
|
|
|
2020-02-12 11:20:54 -05:00
|
|
|
python:
|
|
|
|
- "3.7"
|
|
|
|
|
2020-02-05 15:17:47 -05:00
|
|
|
services:
|
|
|
|
- postgresql
|
2020-02-05 15:53:52 -05:00
|
|
|
- docker
|
2020-02-05 15:17:47 -05:00
|
|
|
|
2020-02-12 11:20:54 -05:00
|
|
|
addons:
|
|
|
|
chrome: stable
|
|
|
|
sonarcloud:
|
|
|
|
organization: "sartography"
|
|
|
|
|
2020-02-05 15:26:08 -05:00
|
|
|
before_install:
|
2020-02-05 15:17:47 -05:00
|
|
|
- cp config/travis-testing.py config/testing.py
|
|
|
|
- psql -c 'create database crc_test;' -U postgres
|
2020-02-05 17:02:20 -05:00
|
|
|
|
|
|
|
install:
|
2020-02-12 11:20:54 -05:00
|
|
|
- pip install pipenv pytest coverage
|
2020-02-05 17:02:20 -05:00
|
|
|
- pipenv install
|
|
|
|
- pytest # <== This runs in Pipenv (a/k/a virtualenv)
|
|
|
|
|
2020-02-05 15:28:41 -05:00
|
|
|
# command to run tests
|
|
|
|
script:
|
2020-02-12 11:31:02 -05:00
|
|
|
- coverage run -m pytest
|
2020-02-12 11:04:04 -05:00
|
|
|
- coverage xml -i
|
2020-02-12 10:31:08 -05:00
|
|
|
- sonar-scanner
|
2020-02-05 15:53:52 -05:00
|
|
|
|
2020-02-05 17:02:20 -05:00
|
|
|
# Would be better to directly test the docker image, may require setting
|
|
|
|
# up a docker-compose with postgres image and this docker image and connecting
|
|
|
|
# them. Which was getting ugly.
|
|
|
|
before_deploy:
|
|
|
|
- docker build -t sartography/cr-connect-workflow .
|
|
|
|
|
2020-02-05 15:53:52 -05:00
|
|
|
deploy:
|
|
|
|
provider: script
|
2020-02-05 17:14:29 -05:00
|
|
|
script: bash docker_push.sh
|
2020-02-05 15:53:52 -05:00
|
|
|
on:
|
2020-02-12 10:31:08 -05:00
|
|
|
branch: master
|