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
|
|
|
|
2014-04-21 02:12:19 +00:00
|
|
|
if test -d gh-pages/avian-web
|
2013-11-24 17:14:26 +00:00
|
|
|
then
|
2014-04-21 02:12:19 +00:00
|
|
|
cd gh-pages/avian-web
|
2013-11-24 17:14:26 +00:00
|
|
|
git pull
|
|
|
|
else
|
2014-04-21 02:12:19 +00:00
|
|
|
git clone --quiet https://${GH_TOKEN}@github.com/ReadyTalk/readytalk.github.io gh-pages > /dev/null
|
|
|
|
cd gh-pages/avian-web
|
2013-11-24 17:14:26 +00:00
|
|
|
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-21 02:12:19 +00:00
|
|
|
git commit -m "Latest javadoc on successful Travis build $TRAVIS_BUILD_NUMBER auto-pushed to readytalk.github.io"
|
|
|
|
if ! git push -fq origin master &> /dev/null; then
|
2014-04-08 04:46:17 +00:00
|
|
|
echo "Error pushing gh-pages to origin. Bad GH_TOKEN? GitHub down?"
|
|
|
|
else
|
2014-04-21 02:12:19 +00:00
|
|
|
echo "Done magic with auto publishment to readytalk.github.io."
|
2014-04-08 04:46:17 +00:00
|
|
|
fi
|
2013-11-21 00:02:33 +00:00
|
|
|
fi
|