-
Notifications
You must be signed in to change notification settings - Fork 26
/
.docgen.sh
32 lines (25 loc) · 917 Bytes
/
.docgen.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
#!/bin/sh
# WARNING: don't display commands which may contain auth tokens
set +ex
eval `opam config env`
opam install xen-gnt xen-evtchn mirage-xen -y
./configure
ocaml setup.ml -configure --enable-docs
make doc
if [ -z "$TRAVIS" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "This is not a push Travis-ci build, doing nothing..."
exit 0
else
echo "Updating docs on Github pages..."
fi
DOCDIR=.gh-pages
if [ -n "$KEEP" ]; then trap "rm -rf $DOCDIR" EXIT; fi
rm -rf $DOCDIR
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/mirage/ocaml-vchan $DOCDIR > /dev/null
cp _build/api.docdir/* $DOCDIR
git -C $DOCDIR config user.email "travis@travis-ci.org"
git -C $DOCDIR config user.name "Travis"
git -C $DOCDIR rm -rf .
git -C $DOCDIR add .
git -C $DOCDIR commit --allow-empty -am "Travis build $TRAVIS_BUILD_NUMBER pushed docs to gh-pages"
git -C $DOCDIR push origin gh-pages > /dev/null