-
Notifications
You must be signed in to change notification settings - Fork 14
/
publish_cron.sh
executable file
·51 lines (45 loc) · 1.16 KB
/
publish_cron.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
#!/bin/sh -e
# Publishes inband track spec to CVS
cd "$(dirname $0)"
echo "# Check GitHub for updates"
LOCAL=$(git rev-parse @{0})
REMOTE=$(git rev-parse @{u})
if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date"
exit 0
else
git pull
fi
# Check CVS
GITUSER="$(git config --get user.email)"
if [ $GITUSER = [email protected] ]; then
CVSUSER=spfeiffe
else
echo "Unable to map $GITUSER to a CVS user"
exit 1
fi
export [email protected]:/sources/public
export CVS_RSH=ssh
if [ ! -e html5 ]; then
echo "# Checkout CVS"
cvs checkout html5/html-sourcing-inband-tracks
else
echo "# Update CVS"
cd html5/html-sourcing-inband-tracks
cvs update -C
cd -
fi
echo
echo "# Generate static HTML"
phantomjs --ssl-protocol=any respec/tools/respec2html.js index.html html5/html-sourcing-inband-tracks/Overview.html
echo "# Commit to CVS"
if [ "$1" != "-f" ]; then
read -p "Really commit? (y) " CONTINUE
if [ "$CONTINUE" != "y" ]; then
echo "Not really."
exit 1
fi
fi
COMMIT="$(git rev-parse HEAD)"
cd html5/html-sourcing-inband-tracks
cvs commit -m "Sync HTML sourcing inband tracks spec with Git commit $COMMIT"