-
Notifications
You must be signed in to change notification settings - Fork 16
/
publish-docs.sh
executable file
·40 lines (25 loc) · 1016 Bytes
/
publish-docs.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
#!/usr/bin/env bash
set -e
echo "Generating Docs"
./gradlew docs --stacktrace
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
echo "Publishing Documentation"
git clone https://${GH_TOKEN}@github.com/grails-plugins/grails-spring-security-shiro.git -b gh-pages gh-pages --single-branch > /dev/null
cd gh-pages
git rm v3/spring-security-shiro-*.epub
mv ../build/docs/spring-security-shiro-*.epub v3
git add v3/spring-security-shiro-*.epub
git rm v3/spring-security-shiro-*.pdf
mv ../build/docs/spring-security-shiro-*.pdf v3
git add v3/spring-security-shiro-*.pdf
mv ../build/docs/index.html v3
git add v3/index.html
mv ../build/docs/ghpages.html index.html
git add index.html
git commit -a -m "Updating docs for Travis build: https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID"
git push origin HEAD
cd ..
rm -rf gh-pages