Update publish
Peter Palfrader

Peter Palfrader commited on 2012-02-17 18:11:49
Zeige 1 geänderte Dateien mit 24 Einfügungen und 3 Löschungen.


- extend ignore list for rsync
- use www-master.torproject.org instead of unqualified vescum
- fix recursive chmod to only try to chmod files that need it
- supported updating with both git and svn instead of just svn
- do not trigger a mirrorrun if there are unreadable files in
  www-master's docroot
... ...
@@ -2,7 +2,13 @@
2 2
 set -e # stop if we encounter an error
3 3
 
4 4
 # pull the latest changes
5
+if [ -e .svn ] ; then
5 6
 	svn update
7
+elif [ -e .git ] ; then
8
+	git svn rebase
9
+else
10
+	echo 2>&1 "Cannot figure out which version control thing you're using.  Skipping update"
11
+fi
6 12
 
7 13
 # clean up the working directory
8 14
 make clean
... ...
@@ -12,8 +18,23 @@ make -j3
12 18
 
13 19
 # don't copy over stuff with permissions that make it useless
14 20
 chmod -R a+r *
15
-rsync --exclude .svn --exclude .deps --exclude svn --exclude dist --exclude releases --exclude torbutton-current.xpi --exclude project -Prvz --delete . vescum:/srv/www-master.torproject.org/htdocs
21
+rsync \
22
+	--exclude .DS_Store \
23
+	--exclude .svn \
24
+	--exclude .git \
25
+	--exclude '.*.sw[po]' \
26
+	--exclude .deps \
27
+	--exclude svn \
28
+	--exclude dist \
29
+	--exclude releases \
30
+	--exclude torbutton-current.xpi \
31
+	--exclude project \
32
+	-Prvz --delete . www-master.torproject.org:/srv/www-master.torproject.org/htdocs
16 33
 
17 34
 echo "Forcing mirror update"
18
-ssh vescum '/home/mirroradm/bin/trigger-mirrors'
19
-ssh vescum chmod g+w -R /srv/www-master.torproject.org/htdocs
35
+ssh -t www-master.torproject.org '
36
+	(
37
+	 find /srv/www-master.torproject.org/htdocs ! -perm +444 -print0 | xargs -0 --no-run-if-empty chmod -v a+r ||
38
+	 echo 2>&1 "There are unreadable files in /srv/www-master.torproject.org/htdocs, not triggering mirror run."
39
+	) &&
40
+	/home/mirroradm/bin/trigger-mirrors'
20 41