diff options
author | Ryo Hashimoto <hashimoto@google.com> | 2020-02-03 18:17:14 +0900 |
---|---|---|
committer | Ryo Hashimoto <hashimoto@google.com> | 2020-02-05 09:03:50 +0000 |
commit | 8fcb4fb5c580bfd9121dd8ddb93d4eb907d23f9e (patch) | |
tree | d30afe0b455266a8177e796f52375c5a04b85a99 /src/CI/travis/generateDocumentationAndDeploy.sh.in | |
parent | 6a8782c7506c89c95cd7443580458a49559f8291 (diff) | |
download | libiio-android11-mainline-sparse-2021-jan-release.tar.gz |
Upgrade to v0.18r_aml_301500702platform-tools-31.0.0platform-tools-30.0.5android-mainline-12.0.0_r55android-mainline-11.0.0_r9android-mainline-11.0.0_r8android-mainline-11.0.0_r7android-mainline-11.0.0_r6android-mainline-11.0.0_r5android-mainline-11.0.0_r45android-mainline-11.0.0_r44android-mainline-11.0.0_r43android-mainline-11.0.0_r42android-mainline-11.0.0_r41android-mainline-11.0.0_r40android-mainline-11.0.0_r4android-mainline-11.0.0_r39android-mainline-11.0.0_r38android-mainline-11.0.0_r37android-mainline-11.0.0_r36android-mainline-11.0.0_r35android-mainline-11.0.0_r34android-mainline-11.0.0_r33android-mainline-11.0.0_r32android-mainline-11.0.0_r31android-mainline-11.0.0_r30android-mainline-11.0.0_r3android-mainline-11.0.0_r29android-mainline-11.0.0_r28android-mainline-11.0.0_r27android-mainline-11.0.0_r26android-mainline-11.0.0_r25android-mainline-11.0.0_r24android-mainline-11.0.0_r23android-mainline-11.0.0_r22android-mainline-11.0.0_r21android-mainline-11.0.0_r20android-mainline-11.0.0_r2android-mainline-11.0.0_r19android-mainline-11.0.0_r18android-mainline-11.0.0_r17android-mainline-11.0.0_r16android-mainline-11.0.0_r15android-mainline-11.0.0_r14android-mainline-11.0.0_r13android-mainline-11.0.0_r12android-mainline-11.0.0_r10android-mainline-11.0.0_r1android-11.0.0_r48android-11.0.0_r47android-11.0.0_r46android-11.0.0_r45android-11.0.0_r44android-11.0.0_r43android-11.0.0_r42android-11.0.0_r41android-11.0.0_r40android-11.0.0_r39android-11.0.0_r38android-11.0.0_r37android-11.0.0_r36android-11.0.0_r35android-11.0.0_r34android-11.0.0_r33android-11.0.0_r32android-11.0.0_r31android-11.0.0_r30android-11.0.0_r29android-11.0.0_r28android-11.0.0_r27android-11.0.0_r26android-11.0.0_r24android-11.0.0_r23android-11.0.0_r22android-11.0.0_r21android-11.0.0_r20android-11.0.0_r19android-11.0.0_r18android-11.0.0_r16android11-qpr3-s1-releaseandroid11-qpr3-releaseandroid11-qpr2-releaseandroid11-qpr1-s2-releaseandroid11-qpr1-s1-releaseandroid11-qpr1-releaseandroid11-qpr1-d-s1-releaseandroid11-qpr1-d-releaseandroid11-qpr1-c-releaseandroid11-mainline-tethering-releaseandroid11-mainline-sparse-2021-jan-releaseandroid11-mainline-sparse-2020-dec-releaseandroid11-mainline-releaseandroid11-mainline-permission-releaseandroid11-mainline-os-statsd-releaseandroid11-mainline-networkstack-releaseandroid11-mainline-media-swcodec-releaseandroid11-mainline-media-releaseandroid11-mainline-extservices-releaseandroid11-mainline-documentsui-releaseandroid11-mainline-conscrypt-releaseandroid11-mainline-cellbroadcast-releaseandroid11-mainline-captiveportallogin-releaseandroid11-devandroid11-d2-releaseandroid11-d1-b-release
Bug: 148763437
Test: make libiio
Change-Id: I9810cec91e823a300a5a9da5e0a6b11053a0e420
(cherry picked from commit 79a1a11db0c1ab0ae311ce69c8762b6b285cd5bf)
Diffstat (limited to 'src/CI/travis/generateDocumentationAndDeploy.sh.in')
-rw-r--r-- | src/CI/travis/generateDocumentationAndDeploy.sh.in | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/src/CI/travis/generateDocumentationAndDeploy.sh.in b/src/CI/travis/generateDocumentationAndDeploy.sh.in new file mode 100644 index 0000000..079913a --- /dev/null +++ b/src/CI/travis/generateDocumentationAndDeploy.sh.in @@ -0,0 +1,97 @@ +#!/bin/sh +set -x +################################################################################ +# Title : generateDocumentationAndDeploy.sh +# Date created : 16Nov2018 +# Original Author: "Jeroen de Bruijn" +# based on https://gist.github.com/vidavidorra/548ffbcdae99d752da02 +# +# Preconditions: +# - Packages doxygen graphviz must be installed. +# - An gh-pages branch should already exist. See below for mor info on how to +# create a gh-pages branch. +# +# Required global variables: +# - GH_DOC_TOKEN : Secure token to the github repository. +# +# This script will generate Doxygen documentation and push the documentation to +# the gh-pages branch of a repository specified by $TRAVIS_REPO_SLUG +# Before this script is used there should already be a gh-pages branch in the +# repository. +# +# This file is processed by CMAKE to get the version in the commit message +# +################################################################################ + +##### Setup this script and get the current gh-pages branch. +echo 'Setting up the script...' +GH_REPO_NAME=$(echo $TRAVIS_REPO_SLUG | awk -F/ '{print $2}') + +# Exit with nonzero exit code if anything fails +set -e + +# by the time this script is run, we should have already made the docs +cd $TRAVIS_BUILD_DIR/build +#docs should be in the $TRAVIS_BUILD_DIR/build/html directory +if [ ! -d "html" ] || [ ! -f "./html/index.html" ]; then + echo '' >&2 + echo 'Warning: No documentation (html) files have been found!' >&2 + echo 'Warning: Not going to push the documentation to GitHub!' >&2 + exit 0 +fi + +if [ -z "${TRAVIS_TAG}" ] ; then + echo 'Warning: Not a tag' >&2 + echo 'Warning: Not going to push the documentation to GitHub!' >&2 + exit 0 +fi + +# Get the current gh-pages branch +git clone -b gh-pages https://git@github.com/$TRAVIS_REPO_SLUG +cd $GH_REPO_NAME + +# Remove everything currently in the gh-pages branch. +# GitHub is smart enough to know which files have changed and which files have +# stayed the same and will only update the changed files. So the gh-pages branch +# can be safely cleaned, and it is sure that everything pushed later is the new +# documentation. +rm -rf * + +#copy the files over +cp -a ../html/* ./ + +##### Configure git. +# Set the push default to simple i.e. push only the current branch. +git config --global push.default simple +# Pretend to be an user called Travis CI. +git config user.name "Autogenerated by Travis CI" +git config user.email "robin.getz@analog.com" + +# Need to create a .nojekyll file to allow filenames starting with an underscore +# to be seen on the gh-pages site. Therefore creating an empty .nojekyll file. +# Presumably this is only needed when the SHORT_NAMES option in Doxygen is set +# to NO, which it is by default. So creating the file just in case. +if [ ! -f ".nojekyll" ] ; then + touch .nojekyll +fi + +################################################################################ +##### Upload the documentation to the gh-pages branch of the repository. ##### + +echo 'Uploading documentation to the gh-pages branch...' +# Add everything in this directory (the Doxygen code documentation) to the +# gh-pages branch. +# +# GitHub is smart enough to know which files have changed and which files have +# stayed the same and will only update the changed files. +git add --all + +# Commit the added files with a title and description containing the Travis CI +# build number and the GitHub commit reference that issued this build. +git commit -m "Deploy autogenerated docs for ${GH_REPO_NAME} v@LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@-g@LIBIIO_VERSION_GIT@" --sign + +# Force push to the remote gh-pages branch. +# The ouput is redirected to /dev/null to hide any sensitive credential data +# that might otherwise be exposed. +git push --force "https://${GH_DOC_TOKEN}@github.com/${TRAVIS_REPO_SLUG}" > /dev/null 2>&1 + |