-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-and-sync
executable file
·42 lines (37 loc) · 1.14 KB
/
update-and-sync
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
#!/bin/bash
# DO NOT USE FOR LOCAL DEVELOPMENT
# this script is used on hack.p6c.org as the 'doc.perl6.org' user to update
# the website. It will remove any local changes you have made in your git checkout
source ~/perl5/perlbrew/etc/bashrc
source /home/rakudobrew/.rakudobrew-bash
set -e
set -x
cd ~/doc
git fetch
before=$(git rev-parse HEAD)
git checkout origin/master
after=$(git rev-parse HEAD)
if [ ! -f "$HOME/force-update" ] ; then
if [ "$before" = "$after" ] ; then
echo "nothing to do"
exit
fi
fi
rm "$HOME/force-update" || true;
LOGDIR=$HOME/logs/build-log
mkdir -p "$LOGDIR"
DATE=$(date --iso-8601=minutes)
LOGFILE="$LOGDIR/build-$DATE.log";
echo "Writing logs to $LOGFILE";
exec >$LOGFILE 2>&1
echo "Building docs for $after with " `perl6 --version`
echo 'Cleaning out old HTML files'
# Clean everything that is not under source control
git clean -xfd
# find html/ -name '*.html' -delete # Old command
# if the htmlify fails, sync the build log.
# since sync-build-log returns false, not the whole thing is synced
time make html || ./util/sync-build-log
./util/sync
./util/sync-build-log || true
# vim: expandtab shiftwidth=4