]>
Commit | Line | Data |
---|---|---|
ac261706 RS |
1 | #!/bin/bash -x |
2 | ||
3 | echo "Generating docs with doxygen..." | |
4 | ||
5 | doxygen | |
6 | ||
6db563f4 | 7 | mkdir -p ~/.ssh |
88e51d59 | 8 | chmod 0600 ~/znc-docs-key |
6db563f4 AS |
9 | cat <<EOF >> ~/.ssh/config |
10 | Host znc-docs | |
11 | HostName github.com | |
12 | User git | |
13 | IdentityFile ~/znc-docs-key | |
1f54731f AS |
14 | StrictHostKeyChecking no |
15 | UserKnownHostsFile /dev/null | |
6db563f4 AS |
16 | EOF |
17 | ||
ac261706 | 18 | cd "$HOME" |
bfbdac2d AS |
19 | git config --global user.email "travis-ci@znc.in" |
20 | git config --global user.name "znc-travis" | |
c9db3064 | 21 | git clone --depth=1 --branch=gh-pages znc-docs:znc/docs.git gh-pages || exit 1 |
ac261706 | 22 | |
d63c419d AS |
23 | cd "$TRAVIS_BUILD_DIR/doc/html/" |
24 | mv ~/gh-pages/.git ./ | |
71964630 | 25 | echo docs.znc.in > CNAME |
d63c419d | 26 | git add -A |
c9db3064 | 27 | |
fa590ac0 | 28 | rm -f ~/docs_need_commit |
a65954bb AS |
29 | git status |
30 | git status | perl -ne '/modified:\s+(.*)/ and print "$1\n"' | while read x; do | |
c9db3064 AS |
31 | echo Checking for useful changes: $x |
32 | git diff --cached $x | | |
33 | perl -ne '/^[-+]/ and !/^([-+])\1\1 / and !/^[-+]Generated.*ZNC.*doxygen/ and exit 1' && | |
34 | git reset -q $x || | |
fa590ac0 | 35 | { echo Useful change detected; touch ~/docs_need_commit; } |
c9db3064 AS |
36 | done |
37 | ||
fa590ac0 | 38 | if [[ ! -f ~/docs_need_commit ]]; then |
c9db3064 AS |
39 | echo "Docs at gh-pages are up to date." |
40 | exit | |
41 | fi | |
42 | ||
72e80f7b AS |
43 | git commit -F- <<EOF |
44 | Latest docs on successful travis build $TRAVIS_BUILD_NUMBER | |
45 | ||
29deb32c | 46 | ZNC commit $TRAVIS_COMMIT |
72e80f7b | 47 | EOF |
ac261706 RS |
48 | git push origin gh-pages |
49 | ||
50 | echo "Published docs to gh-pages." | |
c9db3064 | 51 |