forked from Unidata/python-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
73 lines (66 loc) · 1.94 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
# Since we really don't want any of Travis' Python
language: generic
sudo: false
os:
- linux
- osx
env:
global:
- MINICONDA_DIR="$HOME/miniconda"
- GH_PAGES_DIR="$HOME/site_build/"
matrix:
- Python=3.4
- Python=3.5
matrix:
include:
- os: linux
language: ruby
rvm: 2.2
env: Task=website
before_install:
# Taken from: http://conda.pydata.org/docs/travis.html
- if [[ $Task == 'website' ]]; then
gem install github-pages jekyll-org-mode-converter;
pip install --user linkchecker pyopenssl ndg-httpsclient pyasn1 "requests<=2.9";
else
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi;
bash miniconda.sh -b -p $MINICONDA_DIR;
export PATH="$MINICONDA_DIR/bin:$PATH";
hash -r;
conda config --set always_yes yes --set changeps1 no;
conda update -q conda;
conda info -a;
sed -i -e "s/python=3/python=$Python/" environment.yml;
fi;
install:
- if [[ $Task != 'website' ]]; then
conda env create -f environment.yml;
source activate unidata-workshop;
python --version;
conda list;
fi
script:
- if [[ $Task == 'website' ]]; then
jekyll build -s website -d $GH_PAGES_DIR 2>build.log;
if [ -s build.log ]; then
echo Build produced errors:;
cat build.log;
false;
else
echo Checking links;
linkchecker --anchors --ignore mybinder --check-extern $GH_PAGES_DIR;
fi;
else
find . -name \*.ipynb -print0 | xargs -0 -n1 jupyter nbconvert --execute --ExecutePreprocessor.timeout=180 --to=notebook --stdout >| /dev/null;
fi
deploy:
skip_cleanup: true
provider: script
script: scripts/deploy.sh
on:
branch: master
condition: $Task == 'website'