forked from dedis/Dissent
-
Notifications
You must be signed in to change notification settings - Fork 1
/
check_and_push.sh
executable file
·69 lines (60 loc) · 1.04 KB
/
check_and_push.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
QMAKE=qmake-qt4
github_repo=github
wd=$PWD
rand=$RANDOM
git clone . /tmp/dissent.$rand
cd /tmp/dissent.$rand
function cleanup {
echo $1
cd $wd
}
$QMAKE test.pro
if test $? -ne 0; then
cleanup "Error qmake test.pro"
exit 1
fi
make -j8
if test $? -ne 0; then
cleanup "Error make"
exit 1
fi
./test --gtest_catch_exceptions=0 --gtest_throw_on_failure
if test $? -ne 0; then
cleanup "Error running test"
exit 1
fi
builds="
application.pro
entry_tunnel.pro
exit_tunnel.pro
keygen.pro
"
for build in $builds; do
$QMAKE $build
if test $? -ne 0; then
cleanup "Error qmake $build"
exit 1
fi
make
if test $? -ne 0; then
cleanup "Error make $build"
exit 1
fi
done
cd $wd
git push $github_repo master
if ! test -d $wd/docs/html; then
cleanup "All done!"
rm -rf /tmp/dissent.$rand
exit 0
fi
cd /tmp/dissent.$rand
doxygen dissent.doxy >& /dev/null
rm -rf $wd/docs/html/*
cp -axf docs/html/* $wd/docs/html
cd $wd/docs/html
git add --all .
git commit -m "documentation update"
git push $github_repo gh-pages
cleanup