forked from maidsafe-archive/sentinel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
66 lines (61 loc) · 2.47 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
os:
- linux
- osx
language: rust
sudo: required
rust:
- beta
before_script:
- |
sudo apt-get update -qq &&
sudo apt-get install -qq libcurl4-openssl-dev libelf-dev libdw-dev binutils-dev &&
pip install 'travis-cargo<0.2' --user &&
export PATH=$HOME/.local/bin:$PATH
install:
- wget https://github.com/jedisct1/libsodium/releases/download/1.0.0/libsodium-1.0.0.tar.gz
- tar xvfz libsodium-1.0.0.tar.gz
- cd libsodium-1.0.0 && ./configure --prefix=/usr && make && sudo make install && cd ..
script:
- |
travis-cargo build &&
travis-cargo test &&
travis-cargo bench &&
travis-cargo --only beta doc
after_success: |
if [[ $TRAVIS_BRANCH = master ]] && [[ $TRAVIS_PULL_REQUEST = false ]]; then
cargo doc &&
echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 2`/index.html>" > target/doc/index.html &&
sudo pip install ghp-import &&
mkdir docs-stage &&
COMMIT_MSG=$(git log -1 | tr '[:upper:]' '[:lower:]' | grep "version change to " | tr -d ' ') &&
git clone https://github.com/${TRAVIS_REPO_SLUG}.git docs-stage &&
cd docs-stage &&
git checkout gh-pages;
rm -rf .git*;
# lines 41 - 45 is a patch script for handling old gh-pages structure
OLD_FILE=$(ls | grep "main.js");
if [[ $OLD_FILE == main* ]]; then
rm -rf * &&
echo "<meta http-equiv=refresh content=0;url=master/`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 2`/index.html>" > index.html;
fi
if [[ $COMMIT_MSG == versionchangeto* ]]; then
VERSION=${COMMIT_MSG##*to} &&
mkdir -p $VERSION &&
mkdir -p latest &&
cp -rf ../target/doc/* $VERSION &&
cp -rf ../target/doc/* latest &&
git config --global user.email [email protected] &&
git config --global user.name maidsafe-jenkins &&
git tag $VERSION -a -m "Version $VERSION" &&
git push -q https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG} --tags;
fi
mkdir -p master
cp -rf ../target/doc/* master &&
cd .. &&
ghp-import -n docs-stage &&
git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages;
travis-cargo coveralls;
fi
env:
global:
secure: gzmgOPjX4dbG5iE9YiGVK2YkcaJ57QKqxO0zB7pHSulpNf05OBGmwFFBPmawckODJaeig8NOekD9sdAD7CeWwVKl0Y8ayeleyT2M59S06L/pVrbkAzRy4YCQSvb85fjGsypK3kCh901HPB/o3XOrbY/VSquNGtVGJpot5Vp3AqU=