-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Phil Adams <phil_adams@us.ibm.com>
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# Required environment variables: | ||
# GH_TOKEN | ||
# GH_REPO_SLUG | ||
# GH_TAG | ||
|
||
printf "\n>>>>> Publishing javadoc for release build: repo=%s tag=%s\n" ${GH_REPO_SLUG} ${GH_TAG} | ||
|
||
printf "\n>>>>> Cloning repository's gh-pages branch into directory 'gh-pages'\n" | ||
rm -fr ./gh-pages | ||
git config --global user.email "devxsdk@us.ibm.com" | ||
git config --global user.name "ibm-devx-sdk" | ||
git clone --branch=gh-pages https://${GH_TOKEN}@github.com/IBM/platform-services-java-sdk.git gh-pages | ||
|
||
printf "\n>>>>> Finished cloning...\n" | ||
|
||
pushd gh-pages | ||
|
||
# Create a new directory for this branch/tag and copy the javadocs there. | ||
printf "\n>>>>> Copying javadocs to new directory: docs/%s\n" ${GH_TAG} | ||
rm -rf docs/${GH_TAG} | ||
mkdir -p docs/${GH_TAG} | ||
cp -rf ../target/site/apidocs/* docs/${GH_TAG} | ||
|
||
printf "\n>>>>> Generating gh-pages index.html...\n" | ||
../build/generateJavadocIndex.sh > index.html | ||
|
||
printf "\n>>>>> Committing new javadoc...\n" | ||
git add -f . | ||
git commit -m "docs: latest javadoc for ${GH_TAG}" | ||
git push -f origin gh-pages | ||
|
||
popd | ||
|
||
printf "\n>>>>> Published javadoc for release build: repo=%s tag=%s\n" ${GH_REPO_SLUG} ${GH_TAG} | ||
|