-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
90 lines (80 loc) · 2.82 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
language: python
python:
- 2.7
- 3.6
sudo: false
cache:
timeout: 3600
pip: true
directory:
- ${HOME}/google_appengine
- ${HOME}/google-cloud-sdk
addons:
apt_packages:
- pandoc
env:
global:
- DEPLOY_DIR=tests/docs
- MASTER_BRANCH=master
- DOCS_PY=2.7 # deploy docs from 2.7
matrix:
- TEST_DIR=tests/docs;
GAE_PYTHONPATH=${HOME}/.cache/google_appengine;
PATH=$PATH:${HOME}/google-cloud-sdk/bin;
PYTHONPATH=${PYTHONPATH}:${GAE_PYTHONPATH};
CLOUDSDK_CORE_DISABLE_PROMPTS=1;
- TEST_DIR=tests/notebooks
before_install:
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then
wget http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh -O miniconda.sh;
else
wget http://repo.continuum.io/miniconda/Miniconda3-3.8.3-Linux-x86_64.sh -O miniconda.sh;
fi
- chmod +x miniconda.sh
- ./miniconda.sh -b -p $HOME/miniconda
- export PATH=/home/travis/anaconda/bin:/home/travis/miniconda/bin:$PATH
- conda update --yes conda
# command to install dependencies
install:
- conda install --yes pip python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib cython ipython nose sphinx ;
- pip install -r requirements.txt
- git clone https://github.com/simpeg/simpeg.git
- cd simpeg; git checkout dev; git pull; python setup.py build_ext --inplace; cd ..
- export PATH=$PWD/simpeg:$PATH
# command to run tests
script:
- python tests/execute_notebooks.py
- nosetests $TEST_DIR
after_success:
# early exit if not on a deplotment branch
- if ! [ "$TRAVIS_BRANCH" = "$MASTER_BRANCH" -o "$TRAVIS_TAG" = "true" ]; then
echo "Not deploying (because this is not a deployment branch)" ;
exit 0 ;
fi
- if ! [ "$TEST_DIR" = "$DEPLOY_DIR" ]; then
echo "Not deploying (because this is not a deployment directory)" ;
exit 0 ;
fi
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
echo "Not deploying (because this is a pull request)" ;
exit 0 ;
fi
- if [ $TRAVIS_PYTHON_VERSION == $DOCS_PY ]; then
echo "Not deploying (because this is not the python version we deploy from)" ;
exit 0 ;
fi
# unpack credentials
- openssl aes-256-cbc -K $encrypted_ee5a5d0f1956_key -iv $encrypted_ee5a5d0f1956_iv -in credentials.tar.gz.enc -out credentials.tar.gz -d
- tar -xvzf credentials.tar.gz
# start deploy
- GAE_PYTHONPATH=${HOME}/.cache/google_appengine
- export PATH=$PATH:${HOME}/google-cloud-sdk/bin
- export PYTHONPATH=${PYTHONPATH}:${GAE_PYTHONPATH}
- if [ ! -d ${HOME}/google-cloud-sdk ]; then
curl https://sdk.cloud.google.com | bash;
fi ;
- gcloud auth activate-service-account --key-file credentials/client-secret.json
- gcloud config set project simpegtutorials ;
- gcloud -q app deploy ./docs/app.yaml --version ${TRAVIS_COMMIT} --promote;
notifications:
slack: simpeg:1KZq5giMtlJJ58TijIPgqf7n