From 095e70c79647eae361034abe6d7087a5cce61e54 Mon Sep 17 00:00:00 2001 From: Steven Jardine Date: Wed, 24 Feb 2016 14:28:34 -0700 Subject: [PATCH] Work on auto generating javadoc for gwtbootstrap3-extras. --- .travis.yml | 3 +- .utility/update_site_apidocs.sh | 35 +++++++++++++++++++ ...pdate_demo_site.sh => update_site_demo.sh} | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100755 .utility/update_site_apidocs.sh rename .utility/{update_demo_site.sh => update_site_demo.sh} (98%) diff --git a/.travis.yml b/.travis.yml index f77c7231..cdcd3a59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,5 @@ script: - mvn clean install -DdryRun=true -Dlicense.failOnMissingHeader=true -Dlicense.failOnNotUptodateHeader=true after_success: - .utility/deploy.sh -- .utility/update_demo_site.sh +- .utility/update_site_apidocs.sh +- .utility/update_site_demo.sh diff --git a/.utility/update_site_apidocs.sh b/.utility/update_site_apidocs.sh new file mode 100755 index 00000000..6bf65863 --- /dev/null +++ b/.utility/update_site_apidocs.sh @@ -0,0 +1,35 @@ +#!/bin/bash +set -ev +if [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then + +if [[ -z "$GH_TOKEN" ]]; then +echo -e "GH_TOKEN is not set" +exit 1 +fi + +echo -e "Publishing javadoc to gh-pages . . .\n" + +cp -R ./gwtbootstrap3-extras/target/javadoc $HOME/javadoc-latest + +git config --global user.email "travis@travis-ci.org" +git config --global user.name "travis-ci" + +# clone the gh-pages branch. +cd $HOME +rm -rf gh-pages +git clone --quiet --branch=gh-pages https://$GH_TOKEN@github.com/gwtbootstrap3/gwtbootstrap3-demo gh-pages > /dev/null +cd gh-pages + +# remove the javadoc directories from git. +git rm -rf ./snapshot/extras-apidocs + +# copy the new javadoc to snapshot dir. +cp -Rf $HOME/javadoc-latest ./snapshot/extras-apidocs + +git add -f . +git commit -m "Auto-push javadoc to gh-pages successful. (Travis build: $TRAVIS_BUILD_NUMBER)" +git push -fq origin gh-pages > /dev/null + +echo -e "Published javadoc to gh-pages.\n" + +fi diff --git a/.utility/update_demo_site.sh b/.utility/update_site_demo.sh similarity index 98% rename from .utility/update_demo_site.sh rename to .utility/update_site_demo.sh index d910bf4e..86c25c3f 100755 --- a/.utility/update_demo_site.sh +++ b/.utility/update_site_demo.sh @@ -2,7 +2,7 @@ set -ev if [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then -if [[ -z "$GH_TOKEN" ]]; then +if [ -z "$GH_TOKEN" ]; then echo -e "GH_TOKEN is not set" exit 1 fi