Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add scripts to sync examples.perl6.org with repo build
  • Loading branch information
Paul Cochrane committed Apr 10, 2015
1 parent aa6eb51 commit c2bc065
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/sync
@@ -0,0 +1,2 @@
#!/bin/sh
rsync -az --delete html/* examples.perl6.org@www.p6c.org:/var/www/examples.perl6.org
34 changes: 34 additions & 0 deletions util/update-and-sync
@@ -0,0 +1,34 @@
#!/bin/bash
# this script is used on hack.p6c.org as the 'examples.perl6.org' user to update
# the website.
source /home/rakudobrew/.rakudobrew-bash
set -e
set -x
cd ~/perl6-examples
git fetch
before=$(git rev-parse HEAD)
git checkout origin/master
after=$(git rev-parse HEAD)
if [ "$before" = "$after" ]
then
echo "nothing to do"
else
LOGDIR=$HOME/perl6-examples/html/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 'Cleaning out old HTML files'
# don't clean out html/ entirely, because there are some files
# under version control there, and because of html/build-log/
find html/ -name '*.html' -delete

# if the htmilfy fails, sync the build log.
# since sync-build-log returns false, not the whole thing is synced
time ./htmlify.p6 || ./util/sync-build-log
./util/sync
fi

# vim: expandtab shiftwidth=4

0 comments on commit c2bc065

Please sign in to comment.