forked from mapbox/robosat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
58 lines (46 loc) · 1.87 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
language: generic
sudo: required
dist: trusty
services:
- docker
matrix:
fast_finish: true
include:
- os: linux
compiler: 'python3.6'
addons:
apt:
sources: ['deadsnakes']
packages: ['python3.6', 'python3.6-dev', 'python3.6-tk', 'python3.6-venv', 'build-essential', 'libboost-python-dev', 'libexpat1-dev', 'zlib1g-dev', 'libbz2-dev', 'libspatialindex-dev']
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update && sudo apt-get -y install docker-ce
- sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 10
- python3 -m venv .env && . .env/bin/activate
install:
- python -m pip install http://download.pytorch.org/whl/cpu/torch-0.4.0-cp36-cp36m-linux_x86_64.whl
- python -m pip install -r deps/requirements-lock.txt --quiet
script:
- python -m pytest
- python -m pip install flake8==3.5.0
- flake8 robosat
- python -m pip install black==18.6b4
- black . --exclude .env --check --line-length 120
after_success:
- |
if [[ $TRAVIS_BRANCH == "master" ]]; then
docker build -t mapbox/robosat:latest-cpu -f docker/Dockerfile.cpu .
docker build -t mapbox/robosat:latest-gpu -f docker/Dockerfile.gpu .
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker push mapbox/robosat:latest-cpu
docker push mapbox/robosat:latest-gpu
fi
- |
if [[ ! -z $TRAVIS_TAG ]]; then
docker build -t mapbox/robosat:$TRAVIS_TAG-cpu -f docker/Dockerfile.cpu .
docker build -t mapbox/robosat:$TRAVIS_TAG-gpu -f docker/Dockerfile.gpu .
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker push mapbox/robosat:$TRAVIS_TAG-cpu
docker push mapbox/robosat:$TRAVIS_TAG-gpu
fi