2013-11-21 00:02:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# This script was originally written by maxiaohao in the aws-mock GitHub project.
|
|
|
|
# https://github.com/treelogic-swe/aws-mock/
|
|
|
|
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
|
|
|
|
2013-11-24 17:13:33 +00:00
|
|
|
echo "Start to publish lastest Javadoc to gh-pages..."
|
2013-11-21 00:02:33 +00:00
|
|
|
|
2013-11-24 17:15:11 +00:00
|
|
|
cd build/
|
2013-11-21 00:02:33 +00:00
|
|
|
|
2013-11-24 17:14:26 +00:00
|
|
|
if test -d gh-pages
|
|
|
|
then
|
|
|
|
cd gh-pages
|
|
|
|
git pull
|
|
|
|
else
|
|
|
|
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/ReadyTalk/avian gh-pages > /dev/null
|
|
|
|
cd gh-pages
|
|
|
|
git config user.email "travis@travis-ci.org"
|
|
|
|
git config user.name "travis-ci"
|
|
|
|
fi
|
2013-11-21 00:02:33 +00:00
|
|
|
|
|
|
|
git rm -rf ./javadoc
|
2013-11-24 17:15:11 +00:00
|
|
|
cp -Rf ../javadoc ./javadoc
|
2013-11-21 00:02:33 +00:00
|
|
|
git add -f .
|
2014-04-12 04:19:53 +00:00
|
|
|
git commit -m "Latest javadoc on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages"
|
2014-04-08 04:46:17 +00:00
|
|
|
if ! git push -fq origin gh-pages &> /dev/null; then
|
|
|
|
echo "Error pushing gh-pages to origin. Bad GH_TOKEN? GitHub down?"
|
|
|
|
else
|
|
|
|
echo "Done magic with auto publishment to gh-pages."
|
|
|
|
fi
|
2013-11-21 00:02:33 +00:00
|
|
|
fi
|