aboutsummaryrefslogtreecommitdiffstats
path: root/tests/travis/gen_apidocs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/travis/gen_apidocs.sh')
-rwxr-xr-xtests/travis/gen_apidocs.sh41
1 files changed, 29 insertions, 12 deletions
diff --git a/tests/travis/gen_apidocs.sh b/tests/travis/gen_apidocs.sh
index dc25347c6..248818117 100755
--- a/tests/travis/gen_apidocs.sh
+++ b/tests/travis/gen_apidocs.sh
@@ -34,25 +34,42 @@ if [[ "$TRAVIS_JOB_NUMBER" != "${TRAVIS_BUILD_NUMBER}.1" ]]; then
exit
fi
-# @TODO get newer doxygen
-echo "Doxygen version 1.7 is too old for us :("
-doxygen --version
+# Get newer Doxygen
+#echo "Doxygen version 1.7 is too old for us :("
+#doxygen --version
-# Only build API documentation for master branch push
-if [[ "$TRAVIS_EVENT_TYPE" != "push" ]] || [[ "$TRAVIS_BRANCH" != "master" ]]; then
- echo "Conditions not met to build API documentation."
- echo "We are finished ..."
- exit
+# Travis CI has an old Doxygen 1.7 build, so we fetch a recent static binary
+export DOXY_BINPATH=$HOME/doxygen/doxygen-$DOXY_VER/bin
+if [ ! -e "$DOXY_BINPATH/doxygen" ]; then
+ echo "Installing newer Doxygen $DOXY_VER ..."
+ mkdir -p $HOME/doxygen && cd $HOME/doxygen
+ wget -O - http://ftp.stack.nl/pub/users/dimitri/doxygen-$DOXY_VER.linux.bin.tar.gz | tar xz
+ export PATH=$PATH:$DOXY_BINPATH
fi
+echo "Doxygen version"
+doxygen --version
-echo "Generating Doxygen API documentation for master ..."
-
+echo "Generating Doxygen API documentation ..."
cd $TRAVIS_BUILD_DIR
mkdir -p ./doc/html
-
-# Redirect stderr and stdout to log file and console
+# Redirect stderr and stdout to log file and console to be able to review documentation errors
doxygen $DOXYFILE 2>&1 | tee ./doc/html/doxygen.log
+
+# There is no sane way yet, to prevent missuse of the push tokens in our workflow.
+# We would need a way to limit a token to only push to gh-pages or a way to prevent
+# manipulations to travis scripts which is not possible because we want it to run
+# for pull requests.
+# There are protected branches in GitHub, but they do not work for forced pushes.
+exit
+
+# Only continue for master branch pushes
+if [[ "$TRAVIS_EVENT_TYPE" != "push" ]] || [[ "$TRAVIS_BRANCH" != "master" ]]; then
+ echo "Conditions not met to build API documentation."
+ echo "We are finished ..."
+# exit
+fi
+
# Check if GitHub token is configured in Travis to be able to push to the repo
if [ -z "$GHP_TOKEN" ]; then
echo "No GitHub token configured in Travis, can not deploy to gh-pages ..."