-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Javadoc publishing from Azure (#936)
- Loading branch information
1 parent
f83639a
commit f7da679
Showing
1 changed file
with
19 additions
and
18 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 |
---|---|---|
@@ -1,28 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Source of file: http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ | ||
if [ -z "${GH_TOKEN}" ] && [ "${Build_SourceBranchName}" == "master" ] | ||
then | ||
|
||
echo -e "Generating javadoc...\n" | ||
./gradlew aggregateJavadocs | ||
if [ -z ${GH_TOKEN+x} ]; then | ||
echo "GH_TOKEN is unset, cannot publish Javadoc" | ||
exit 0; | ||
fi | ||
|
||
echo -e "Publishing javadoc...\n" | ||
echo -e "Generating javadoc...\n" | ||
./gradlew aggregateJavadocs | ||
|
||
cp -R build/docs/javadoc $HOME/javadoc-latest | ||
echo -e "Publishing javadoc...\n" | ||
|
||
cd $HOME | ||
git config --global user.email "azuredevops@microsoft.com" | ||
git config --global user.name "azure-pipelines" | ||
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/WPIRoboticsProjects/grip gh-pages #> /dev/null | ||
cp -R build/docs/javadoc $HOME/javadoc-latest | ||
|
||
cd gh-pages | ||
git rm -rf ./javadoc | ||
cp -Rf $HOME/javadoc-latest ./javadoc | ||
git add -f . | ||
git commit -m "Lastest javadoc on successful Azure build ${Build_BuildNumber} auto-pushed to gh-pages" | ||
git push -fq origin gh-pages #> /dev/null | ||
cd $HOME | ||
git config user.email "azuredevops@microsoft.com" | ||
git config user.name "azure-pipelines" | ||
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/WPIRoboticsProjects/grip gh-pages #> /dev/null | ||
|
||
echo -e "Published Javadoc to gh-pages.\n" | ||
cd gh-pages | ||
git rm -rf ./javadoc | ||
cp -Rf $HOME/javadoc-latest ./javadoc | ||
git add -f . | ||
git commit -m "Lastest javadoc on successful Azure build ${BUILD_BUILD_NUMBER} auto-pushed to gh-pages" | ||
git push -fq origin gh-pages #> /dev/null | ||
|
||
fi | ||
echo -e "Published Javadoc to gh-pages.\n" |