Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #!/bin/sh | ||
| rsync -az --delete html/* examples.perl6.org@www.p6c.org:/var/www/examples.perl6.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |