Skip to content

Commit 425d8c7

Browse files
Merge pull request #222 from watson-developer-cloud/latest-docs-symlink
automatically create latest/ symlink in docs for tagged builds
2 parents 1ad841a + ead7f3c commit 425d8c7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.utility/push-javadoc-to-gh-pages.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ if [ "$TRAVIS_REPO_SLUG" == "watson-developer-cloud/java-sdk" ] && [ "$TRAVIS_PU
1313

1414
cp -rf ../target/site/apidocs/* docs/$TRAVIS_BRANCH
1515
../.utility/generate_index_html.sh > index.html
16+
17+
# update the latest/ symlink
18+
# on tagged builds, $TRAVIS_TAG is set to the tag, but it's blank on regular builds, unlike $TRAVIS_BRANCH
19+
if [ $TRAVIS_TAG ]; then
20+
rm latest
21+
ln -s ./$TRAVIS_TAG latest
22+
fi
1623

1724
git add -f .
1825
git commit -m "Latest javadoc for $TRAVIS_BRANCH ($TRAVIS_COMMIT)"

0 commit comments

Comments
 (0)