rsync to regolas
authorDaniel Bohrer <Daniel Bohrer@stratum0.org/mediawiki/>
Tue, 9 Aug 2016 03:02:33 +0000 (03:02 +0000)
committerDaniel Bohrer <Daniel Bohrer@stratum0.org/mediawiki/>
Tue, 9 Aug 2016 03:02:33 +0000 (03:02 +0000)
Theodem.mw

index 18c1d98..fc55fb4 100644 (file)
 ** <s>Git-Hooks im Admin-Repo: siehe http://gitolite.com/gitolite/gitolite.html#hooks</s>
 ** s0v-finanzen-Hook-Scripte sind in <tt>/var/lib/gitolite3/scripts</tt>
 ** Hook ist manuell im Repository angelegt
-** TODO: Ablage der generierten Dateien auf Webspace, Nightly-Tests integrieren
+** TODO: Nightly-Tests integrieren
 * SSH via Port-Forwarding von [[gandolf]], Port 2222
+* Alle Dateien in <tt>/var/www/html</tt> werden auf [[regolas]] gesynct, sobald die Datei <tt>/var/www/html/.dirty</tt> angelegt wird (z.B. durch Ausführen von <tt>/usr/local/bin/regolas-rsync</tt>). Die Dateien sind damit unter https://data.stratum0.org erreichbar.
+
+=== Skripte etc ===
+/home/regolas-rsync/bin/regolas-rsync:
+ #!/bin/sh
+ rsync \
+   --recursive --delete --stats \
+   --chmod=D2755,F644 \
+   --exclude='.*' \
+   /var/www/html/ theodem-rsync@regolas:/var/www/data.stratum0.org/ | \ 
+   sed 's/^/regolas-rsync: /'  
+
+/etc/systemd/system/regolas-rsync.service:
+ [Unit]
+ Description=rsync everything from /var/www/html to regolas
+ Requires=network.target
+ [Service]
+ User=regolas-rsync
+ Group=www-data
+ ExecStart=/bin/sh -c '                            \
+   while true; do                                  \
+     if [ -r /var/www/html/.dirty ]; then          \
+       /home/regolas-rsync/bin/regolas-rsync;      \
+       rm -f /var/www/html/.dirty;                 \
+     fi;                                           \
+     sleep 1;                                      \                                                    
+   done'
+ Restart=always
+ [Install]
+ WantedBy=multi-user.target
+
+
 
 [[Kategorie:Virtuelle Maschine]]
 [[Kategorie:Infrastruktur]]
This page took 0.02998 seconds and 4 git commands to generate.