forked from pylover/easycli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis-upload-doc.sh
executable file
·47 lines (38 loc) · 1.1 KB
/
.travis-upload-doc.sh
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
#!/usr/bin/env bash
set -e # Exit with nonzero exit code if anything fails
# Save some useful information
REPO="[email protected]:${TRAVIS_REPO_SLUG}.git"
SHA=`git rev-parse --verify HEAD`
DOC="project-gh-pages"
SSH_PRIVATEKEY=".githubdeploy-rsa"
openssl aes-256-cbc \
-K $encrypted_110aca95eb88_key \
-iv $encrypted_110aca95eb88_iv \
-in .githubdeploy-rsa.enc \
-out $SSH_PRIVATEKEY \
-d
chmod 600 $SSH_PRIVATEKEY
eval `ssh-agent -s`
ssh-add $SSH_PRIVATEKEY
# Clone/checkout the gh-pages branch from Github alongside the master branch working copy directory :
rm -rf ../${DOC}
git -C .. clone -b gh-pages ${REPO} ${DOC}
GIT="git -C ../${DOC}"
${GIT} config user.name "pylover"
${GIT} config user.email "[email protected]"
# Installing dependencies
pip install -r requirements-doc.txt
cd sphinx
make doctest
make html
cd ..
# Deploy
$GIT rm \*.\*
cp -r sphinx/_build/html/* ../${DOC}
cp -r sphinx/_build/html/.buildinfo ../${DOC}
touch ../${DOC}/.nojekyll
echo "easycli.dobisel.com" > ../${DOC}/CNAME
$GIT add .
# Commit & push
${GIT} commit -am "Deploy to GitHub Pages: ${SHA}"
${GIT} push origin gh-pages