forked from CE-Programming/toolchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.deploy.sh
42 lines (34 loc) · 1.35 KB
/
.deploy.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
41
#!/bin/bash
set -ex
# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]; then
echo -e "Skipping deploy actions; just doing a build.\n"
exit 0
fi
# Only perform below actions on a tagged (release) commit
git describe --exact-match --tags HEAD || exit 0
rev=$(git rev-parse --short HEAD)
git config user.name "Travis CI"
git config user.email "[email protected]"
# Deploy latest tested_funcs into wiki
cd ${TRAVIS_BUILD_DIR}/tools/funcs_tested
git clone --depth 1 https://github.com/CE-Programming/toolchain.wiki.git
cd toolchain.wiki
if ! cmp ../tested-functions-list.md ./Tested-functions-list.md >/dev/null 2>&1
then
git remote add upstream "https://[email protected]/CE-Programming/toolchain.wiki.git"
git fetch upstream && git reset upstream/master
cp ../tested-functions-list.md ./Tested-functions-list.md
git add ./Tested-functions-list.md
git commit -m "update tested functions list"
git push -q upstream HEAD:master
fi
# Deploy updated docs
cd ${TRAVIS_BUILD_DIR}/doxygen/html
git init
git remote add upstream "https://[email protected]/CE-Programming/toolchain.git"
git fetch upstream && git reset upstream/gh-pages
touch .
git add -A .
git commit -m "rebuild pages at ${rev}"
git push -q upstream HEAD:gh-pages