forked from busy-beaver-dev/busy-beaver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
40 lines (32 loc) · 970 Bytes
/
.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
notifications:
email: false
dist: xenial
sudo: required
services:
- postgresql
- redis-server
addons:
postgresql: "10"
language: python
python:
- "3.7"
env:
- PYTHONPATH=. FLASK_APP=busy_beaver/__init__.py DATABASE_URI="postgresql://[email protected]:5432/busy_beaver_test" REDIS_URI="redis://127.0.0.1:6379" IMAGE_NAME="alysivji/busy-beaver"
install:
- pip install -r requirements_dev.txt
before_script:
- psql -c 'create database busy_beaver_test;' -U postgres
script:
- flask db upgrade
- pytest --cov=./busy_beaver
- flake8
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker pull ${IMAGE_NAME} || true
- docker build -f docker/prod/Dockerfile --pull --cache-from ${IMAGE_NAME} --tag ${IMAGE_NAME} --tag ${IMAGE_NAME}:${TRAVIS_COMMIT} .
deploy:
provider: script
script:
- docker push ${IMAGE_NAME} && docker push ${IMAGE_NAME}:${TRAVIS_COMMIT}
on:
branch: master