aboutsummaryrefslogtreecommitdiffstats
path: root/tests/travis/gen_apidocs.sh
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2016-11-06 21:31:02 +0100
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2017-03-14 20:36:38 +0100
commit03db9833e833959bb2414b736fddb967763d0d4f (patch)
tree2eb154ca40f04e9d3eea449598b0fb075e621ad5 /tests/travis/gen_apidocs.sh
parent33153b8f3a2e4974ae5b1e9f4017f669e35207fe (diff)
downloadvolse-hubzilla-03db9833e833959bb2414b736fddb967763d0d4f.tar.gz
volse-hubzilla-03db9833e833959bb2414b736fddb967763d0d4f.tar.bz2
volse-hubzilla-03db9833e833959bb2414b736fddb967763d0d4f.zip
:green_heart: Update Travis CI's Doxygen.
Travis CI has Doxygen 1.7. We need 1.8 to generate our API documentation. Get a static version and use it. Always build API Documentation, but changed Doxygen configuration to only print out errors in the documentation generation, so these can be reviewed.
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 ..."