-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
94 lines (86 loc) · 2.95 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
91
92
93
94
sudo: required
dist: trusty
language: python
addons:
apt:
packages:
- swig
- libatlas-dev
- libatlas-base-dev
- liblapack-dev
- gfortran
- libgmp-dev
- libmpfr-dev
- ccache
- libfreetype6-dev
- libpng-dev
- zlib1g-dev
- texlive-fonts-recommended
- doxygen
- mscgen
- texlive-latex-base
- texlive-latex-extra
- texlive-fonts-recommended
- texlive-latex-recommended
- texlive-font-utils
matrix:
include:
- python: 2.7
- python: 3.5
# mscgen is not currently allowed in travis so we explicitly sudo it
# See https://github.com/travis-ci/apt-package-whitelist/issues/2243
install:
- |
pip install --upgrade pip
pip install --upgrade wheel
pip install --upgrade setuptools
pip install numpy
pip install scipy
pip install behave
pip install sphinx sphinxcontrib-bibtex Breathe
script:
- |
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/home/travis/virtualenv/python${TRAVIS_PYTHON_VERSION}/
make
ctest --output-on-failure
make install
export LD_LIBRARY_PATH=/home/travis/virtualenv/python${TRAVIS_PYTHON_VERSION}/lib:$LD_LIBRARY_PATH
make documentation
after_success:
- |
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'DCPROGS/HJCFIT' && $TRAVIS_PYTHON_VERSION == '3.5' && ($TRAVIS_BRANCH == 'develop' || $TRAVIS_BRANCH == 'master')]]; then
echo "Uploading documentation"
cd ..
openssl aes-256-cbc -K $encrypted_ca9944a40522_key -iv $encrypted_ca9944a40522_iv -in .travis/deploykeys.tar.enc -out deploykeys.tar -d
tar -xvf deploykeys.tar
if [[ $TRAVIS_BRANCH == 'develop' ]]; then
cp DCPROGSDeployKeyDevelop DCPROGSDeployKey
export DOCSREPONAME=HJCFITdevdocs
elif [[ $TRAVIS_BRANCH == 'master' ]]; then
cp DCPROGSDeployKeyMaster DCPROGSDeployKey
export DOCSREPONAME=HJCFITmasterdocs
fi
eval `ssh-agent -s`
chmod 600 DCPROGSDeployKey
ssh-add DCPROGSDeployKey
cd ..
pwd
git clone [email protected]:DCPROGS/${DOCSREPONAME}.git
cd ${DOCSREPONAME}
git checkout gh-pages
git reset --hard first_commit
cp -R ../HJCFIT/build/documentation/sphinx/. .
touch .nojekyll
ls -la
git config --global user.email "DCPROGSTravisBot@nomail"
git config --global user.name "DCPROGSTravisBot"
git config --global push.default simple
git add .
git commit -m "Docs build of $TRAVIS_COMMIT"
git status
git push --set-upstream origin gh-pages --force
else
echo "Will only deploy docs build from development or master branch"
fi