Skip to content

Commit

Permalink
Publish to gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffscottbrown committed Nov 27, 2017
1 parent f604466 commit 2664617
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
language: groovy
sudo: false
#cache:
# directories:
# - "$HOME/.gradle"
jdk:
- oraclejdk8
script: "./travis-build.sh"
Expand All @@ -11,3 +8,4 @@ env:
global:
- GIT_NAME="Jeff Scott Brown"
- GIT_EMAIL="[email protected]"
- secure: u++4FsiROecURcgO350kQHKSRLi6ZupBPB+kw5HqOceQdnbdda4mfyxIRFT+44NtrEt9xhJPSCk7avcN/hGnbzdVAOQDf7hPvyMBk4nOJoG59/UY9skyZ6E0eHZY+GzpG827dbp+U2Slv75VhzyradDSErOtQ/vUMiwHSe7i6Yb6hPIMhRVFfJnz7oFF+bJrSUP9kUmKeQ9CuIqO0OAqZVsoQSqFD5qwG+WKuQBwQMlAwekoJawgPuQCLv5aFws/Z10CPYBaNt2D0kByPa2LknFsEMDlWujcmOkmW5HE9WIYNuZ6uia7mU6gaHG0gF3+AnqugOavuf8y26oFg1ygUVLWuGIVQKC8q/SjeSl+GBbQ3+vqplA+i356AkCxmEw5u/mVjkmftOQCL2K8SyaMJ4N0LtGhFp0z2nvlSdPFMXVP1TSyyTUsBTyQHDMp7GkOvcgrkJiiAULsEcDoVWxdPLeY5DUtG2G5g6vfovvAPwRrJhJf2fgeDBrmRSJUi7BTF3Pa35mW0x/DIbW5+4hLf+FgEAJGNSsM5mgL9w80tasZvGbtyNBt5yWnCDA8Wm5HpASkfEpBNEKLI0KZn5y12qtFPTsS9uBVe9cNQcA8kxsUBKQnJH6VjI4xjrcQQeqFsRbmoX3Yuc1lF9qt2Uxr63DV7SZ+9yYQGg6mSTI63kA=
27 changes: 27 additions & 0 deletions travis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,33 @@ cd ../3.3.x

EXIT_STATUS=0

echo "Publishing Docs For Branch $TRAVIS_BRANCH"
if [[ $TRAVIS_BRANCH =~ ^master$ && $TRAVIS_PULL_REQUEST == 'false' ]]; then

cd ../
./gradlew ascii || EXIT_STATUS=$?
echo "Docs status: $EXIT_STATUS"

git config --global user.name "$GIT_NAME"
git config --global user.email "$GIT_EMAIL"
git config --global credential.helper "store --file=~/.git-credentials"
echo "https://$GH_TOKEN:@github.com" > ~/.git-credentials

git clone https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git -b gh-pages gh-pages --single-branch > /dev/null
cd gh-pages

# If this is the master branch then update the snapshot
rm -rf *.html *.js images
cp -R ../build/asciidoc/html5/* .
git add .

git commit -a -m "Updating docs for Travis build: https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID" && {
git push origin HEAD || true
}
cd ..
rm -rf gh-pages
fi

echo "Finished build with status: $EXIT_STATUS"

exit $EXIT_STATUS

0 comments on commit 2664617

Please sign in to comment.