From 19fe29f43da3865084b819fbe07d9c00c4e2a6eb Mon Sep 17 00:00:00 2001 From: Nick Minkler Date: Mon, 23 Jun 2014 13:20:15 -0700 Subject: [PATCH] add script to publish javadocs to gh-pages branch after building new API versions on travis. --- .travis.yml | 7 ++++++- .utility/do-publish.sh | 19 +++++++++++++++++++ pom.xml | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .utility/do-publish.sh diff --git a/.travis.yml b/.travis.yml index 1bc5d1e..01b0ce3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,2 +1,7 @@ language: java -jdk: [ openjdk6 ] \ No newline at end of file +jdk: [ openjdk6 ] +env: + global: + secure: lkC+9PeVPx0sFEAITPszoHvPV9jnavsJdA3Slo4FakzTB5AlERHszto4RdenAhPf347r8xKL120YvDxDeYvmffpG7NUcRXfQZxod1SRyFEFUUBC0zGHkLiJlBjAqkSEDacruldT4+1BCqRc/A96zj17knmUkvKnyutQtasOGKxk= +after_success: +- .utility/do-publish.sh diff --git a/.utility/do-publish.sh b/.utility/do-publish.sh new file mode 100644 index 0000000..e97465f --- /dev/null +++ b/.utility/do-publish.sh @@ -0,0 +1,19 @@ +if [ "$TRAVIS_REPO_SLUG" != "MilkBowl/VaultAPI"] || [ "$TRAVIS_PULL_REQUEST" == "true" ] || [ "$TRAVIS_BRANCH" != "master" ] +then + echo 'Travis can only publish docs for release builds.' + return 0 +fi + +# Get to the Travis build directory, configure git and clone the repo +cd $HOME +git config --global user.email "travis@travis-ci.org" +git config --global user.name "travis-ci" +git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/MilkBowl/VaultAPI gh-pages > /dev/null + +# Commit and Push the Changes +cd gh-pages +git rm -rf * +cp -Rf $HOME/VaultAPI/target/javadoc-latest/* ./ +git add -f . +git commit -m "Latest javadoc on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages" +git push -fq origin gh-pages > /dev/null diff --git a/pom.xml b/pom.xml index e8c72dd..29993f4 100644 --- a/pom.xml +++ b/pom.xml @@ -96,6 +96,8 @@ true true Milkbowl, 2014]]> + ${project.build.directory} + javadoc-latest