2014-06-23 22:44:28 +02:00
|
|
|
#!/bin/bash
|
2014-06-23 23:14:28 +02:00
|
|
|
current_dir=`pwd`
|
2014-06-23 23:42:19 +02:00
|
|
|
|
2014-06-23 23:13:02 +02:00
|
|
|
if [[ "$TRAVIS_REPO_SLUG" != "MilkBowl/VaultAPI" || "$TRAVIS_PULL_REQUEST" == "true" || "$TRAVIS_BRANCH" != "master" ]]
|
2014-06-23 22:44:28 +02:00
|
|
|
then
|
|
|
|
echo 'Travis can only publish docs for release builds.'
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
2014-06-24 02:04:05 +02:00
|
|
|
mvn clean javadoc:javadoc javadoc:jar deploy --settings .utility/settings.xml
|
|
|
|
|
2014-06-23 22:44:28 +02:00
|
|
|
# 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 *
|
2014-06-23 23:14:28 +02:00
|
|
|
cp -Rfv $current_dir/target/javadoc-latest/* ./
|
2014-06-23 22:44:28 +02:00
|
|
|
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
|