Behdad Esfahbod | d08035f | 2015-12-30 16:15:36 +0100 | [diff] [blame] | 1 | #!/bin/bash |
Khaled Hosny | b789199 | 2015-12-26 06:35:08 +0400 | [diff] [blame] | 2 | |
Behdad Esfahbod | 0d45c3c | 2015-12-30 16:09:39 +0100 | [diff] [blame] | 3 | set -x |
Behdad Esfahbod | d08035f | 2015-12-30 16:15:36 +0100 | [diff] [blame] | 4 | set -o errexit -o nounset |
Khaled Hosny | 22b0778 | 2015-12-14 23:33:51 +0400 | [diff] [blame] | 5 | |
Khaled Hosny | 3ce6c7b | 2017-12-06 21:08:20 +0200 | [diff] [blame] | 6 | if test "x$TRAVIS_SECURE_ENV_VARS" != xtrue; then exit; fi |
| 7 | |
Behdad Esfahbod | d08035f | 2015-12-30 16:15:36 +0100 | [diff] [blame] | 8 | BRANCH="$TRAVIS_BRANCH" |
Behdad Esfahbod | 33b2d98 | 2015-12-30 15:56:56 +0100 | [diff] [blame] | 9 | if test "x$BRANCH" != xmaster; then exit; fi |
| 10 | |
Behdad Esfahbod | d08035f | 2015-12-30 16:15:36 +0100 | [diff] [blame] | 11 | TAG="$(git describe --exact-match --match "[0-9]*" HEAD 2>/dev/null || true)" |
Behdad Esfahbod | f3a0511 | 2015-12-30 15:45:43 +0100 | [diff] [blame] | 12 | |
Behdad Esfahbod | f3a0511 | 2015-12-30 15:45:43 +0100 | [diff] [blame] | 13 | DOCSDIR=build-docs |
Behdad Esfahbod | 33b2d98 | 2015-12-30 15:56:56 +0100 | [diff] [blame] | 14 | REVISION=$(git rev-parse --short HEAD) |
Behdad Esfahbod | f3a0511 | 2015-12-30 15:45:43 +0100 | [diff] [blame] | 15 | |
| 16 | rm -rf $DOCSDIR || exit |
| 17 | mkdir $DOCSDIR |
| 18 | cd $DOCSDIR |
| 19 | |
| 20 | cp ../docs/html/* . |
Ebrahim Byagowi | a13c074 | 2017-11-21 09:52:18 +0330 | [diff] [blame] | 21 | #cp ../docs/CNAME . |
Behdad Esfahbod | f3a0511 | 2015-12-30 15:45:43 +0100 | [diff] [blame] | 22 | |
| 23 | git init |
| 24 | git config user.name "Travis CI" |
| 25 | git config user.email "travis@harfbuzz.org" |
Behdad Esfahbod | 0d45c3c | 2015-12-30 16:09:39 +0100 | [diff] [blame] | 26 | set +x |
Ebrahim Byagowi | a13c074 | 2017-11-21 09:52:18 +0330 | [diff] [blame] | 27 | echo "git remote add upstream \"https://\$GH_TOKEN@github.com/harfbuzz/harfbuzz.github.io.git\"" |
| 28 | git remote add upstream "https://$GH_TOKEN@github.com/harfbuzz/harfbuzz.github.io.git" |
Behdad Esfahbod | 0d45c3c | 2015-12-30 16:09:39 +0100 | [diff] [blame] | 29 | set -x |
Behdad Esfahbod | f3a0511 | 2015-12-30 15:45:43 +0100 | [diff] [blame] | 30 | git fetch upstream |
Ebrahim Byagowi | a13c074 | 2017-11-21 09:52:18 +0330 | [diff] [blame] | 31 | git reset upstream/master |
Behdad Esfahbod | f3a0511 | 2015-12-30 15:45:43 +0100 | [diff] [blame] | 32 | |
| 33 | touch . |
| 34 | git add -A . |
Khaled Hosny | 77efdec | 2017-11-22 00:14:29 +0200 | [diff] [blame] | 35 | git commit -m "Rebuild docs for https://github.com/harfbuzz/harfbuzz/commit/$REVISION" |
Ebrahim Byagowi | a13c074 | 2017-11-21 09:52:18 +0330 | [diff] [blame] | 36 | git push -q upstream HEAD:master |