2006-07-31 21:15:41 +00:00
|
|
|
#!/bin/sh
|
2006-09-23 16:55:47 +00:00
|
|
|
set -e # stop if we encounter an error
|
|
|
|
|
2012-02-19 12:54:52 +00:00
|
|
|
# pull the latest changes
|
|
|
|
if [ -e .svn ] ; then
|
|
|
|
svn update
|
|
|
|
elif [ -e .git ] ; then
|
|
|
|
git svn rebase
|
|
|
|
else
|
|
|
|
echo 2>&1 "Cannot figure out which version control thing you're using. Skipping update"
|
|
|
|
fi
|
2012-01-16 10:56:03 +00:00
|
|
|
|
2012-02-19 12:54:52 +00:00
|
|
|
# clean up the working directory
|
|
|
|
make clean
|
2012-01-16 10:56:03 +00:00
|
|
|
|
2012-02-19 12:54:52 +00:00
|
|
|
# actually build the site
|
|
|
|
make -j3
|
2006-07-31 21:15:41 +00:00
|
|
|
|
2006-07-31 22:21:32 +00:00
|
|
|
# don't copy over stuff with permissions that make it useless
|
2011-10-19 05:40:15 +00:00
|
|
|
chmod -R a+r *
|
2012-02-19 12:54:52 +00:00
|
|
|
rsync \
|
|
|
|
--exclude .DS_Store \
|
|
|
|
--exclude .svn \
|
|
|
|
--exclude .git \
|
|
|
|
--exclude '.*.sw[po]' \
|
|
|
|
--exclude .deps \
|
|
|
|
--exclude svn \
|
2013-10-17 03:08:47 +00:00
|
|
|
--exclude README \
|
2012-02-19 12:54:52 +00:00
|
|
|
--exclude dist \
|
|
|
|
--exclude releases \
|
|
|
|
--exclude torbutton-current.xpi \
|
|
|
|
--exclude project \
|
2012-05-20 08:25:31 +00:00
|
|
|
-Prvz --delete . www-master.torproject.org:/srv/www-master.torproject.org/htdocs
|
2010-03-08 23:53:51 +00:00
|
|
|
|
|
|
|
echo "Forcing mirror update"
|
2012-05-20 08:25:31 +00:00
|
|
|
ssh www-master.torproject.org '
|
2012-02-19 12:54:52 +00:00
|
|
|
(
|
|
|
|
find /srv/www-master.torproject.org/htdocs ! -perm -444 -print0 | xargs -0 --no-run-if-empty chmod -v a+r ||
|
|
|
|
( echo >&2 "There are unreadable files in /srv/www-master.torproject.org/htdocs, not triggering mirror run."; exit 1)
|
|
|
|
) &&
|
|
|
|
echo "Triggering mirror run" &&
|
|
|
|
/home/mirroradm/bin/trigger-mirrors'
|