-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtravis-build.sh
executable file
·40 lines (25 loc) · 1.07 KB
/
travis-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e
export EXIT_STATUS=0
./gradlew clean check || EXIT_STATUS=$?
if [[ $EXIT_STATUS -eq 0 ]]; then
./gradlew docs || EXIT_STATUS=$?
if [[ $EXIT_STATUS -eq 0 ]]; then
if [[ -n $TRAVIS_TAG ]]; then
echo "Publishing Documentation"
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/grails-samples/google-bookshelf.git -b gh-pages gh-pages --single-branch > /dev/null
cp -r docs/build/asciidoc/html5/* gh-pages/
cd gh-pages
git add .
git commit -a -m "Updating Documentation for Travis Build: https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID"
git push origin HEAD
cd ..
rm -rf gh-pages
fi
fi
fi
exit $EXIT_STATUS