forked from umccr/umccrise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
66 lines (59 loc) · 2.38 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
59
60
61
62
63
64
65
66
sudo: required
dist: trusty
language: python
python:
# We don't actually use the Travis Python (since we are on conda), but this keeps it organized.
- "3.6"
install:
##########################################
## To pull cached miniconda and update: ##
##########################################
# Get and install anaconda (https://conda.io/docs/travis.html) and packages
- if [ -d $HOME/miniconda ]; then echo "ls HOME/miniconda:" ; ls $HOME/miniconda ; fi ;
- if [ ! -d $HOME/miniconda/bin ] ; then
if [ -d $HOME/miniconda ] ; then rm -rf $HOME/miniconda ; fi ;
wget -nv https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh ;
bash miniconda.sh -b -p $HOME/miniconda ;
export PATH=$HOME/miniconda/bin:$PATH ;
hash -r ;
conda config --set always_yes yes --set changeps1 no ;
conda update -q conda ;
conda env create -n umccrise --file environment.yml ;
else
export PATH=$HOME/miniconda/bin:$PATH ;
echo "else ls HOME/miniconda:" ; ls $HOME/miniconda ;
conda config --set always_yes yes --set changeps1 no ;
conda env update -f environment.yml ;
fi
- source activate umccrise
# Useful for debugging any issues with conda
- conda info -a
# Installing the codebase (source code was automatically cloned into CWD by Travis)
- pip install -e .
- R -e "library(devtools) ; options(unzip = '/usr/bin/unzip') ; devtools::install_github('umccr/rock', ref = 'umccrise')"
# Clone the test data
- git clone https://github.com/umccr/umccrise_test_data
# Skip caching for now so we can remove miniconda folder and save space for deploy. Consider
#cache:
# directories:
# - $HOME/miniconda
# timeout: 600 # allow 10 minutes to cache instead of default 3 minutes
script:
- nosetests --nocapture umccrise_test_data/test.py -a normal
services:
- docker
addons:
apt:
packages:
- docker-ce
after_success:
# Building docker image
- test $TRAVIS_BRANCH = "master" && grep -qv dev VERSION.txt &&
docker version &&
rm -rf $HOME/miniconda umccrise_test_data &&
docker build -t umccr/umccrise:$(cat VERSION.txt) -f Dockerfile .
# Pushing docker image
- test $TRAVIS_BRANCH = "master" && grep -qv dev VERSION.txt &&
docker images &&
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USER" --password-stdin &&
docker push umccr/umccrise:$(cat VERSION.txt)