From ead7f3c482223261ab519d03641c5822eb333ba5 Mon Sep 17 00:00:00 2001 From: Nathan Friedly Date: Tue, 29 Mar 2016 09:18:22 -0400 Subject: [PATCH] automatically create latest/ symlink in docs for tagged builds --- .utility/push-javadoc-to-gh-pages.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.utility/push-javadoc-to-gh-pages.sh b/.utility/push-javadoc-to-gh-pages.sh index 5ea305838c8..94680af937d 100755 --- a/.utility/push-javadoc-to-gh-pages.sh +++ b/.utility/push-javadoc-to-gh-pages.sh @@ -13,6 +13,13 @@ if [ "$TRAVIS_REPO_SLUG" == "watson-developer-cloud/java-sdk" ] && [ "$TRAVIS_PU cp -rf ../target/site/apidocs/* docs/$TRAVIS_BRANCH ../.utility/generate_index_html.sh > index.html + + # update the latest/ symlink + # on tagged builds, $TRAVIS_TAG is set to the tag, but it's blank on regular builds, unlike $TRAVIS_BRANCH + if [ $TRAVIS_TAG ]; then + rm latest + ln -s ./$TRAVIS_TAG latest + fi git add -f . git commit -m "Latest javadoc for $TRAVIS_BRANCH ($TRAVIS_COMMIT)"