From: Martin Mares Date: Wed, 26 Dec 2012 20:30:51 +0000 (+0100) Subject: Gallery2: Added gal-mj-upload X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=58b154fc9db18054969a3c530f28e6aeadc349a9;p=gallery.git Gallery2: Added gal-mj-upload --- diff --git a/gal2/bin/gal-mj-upload b/gal2/bin/gal-mj-upload new file mode 100755 index 0000000..5ce096d --- /dev/null +++ b/gal2/bin/gal-mj-upload @@ -0,0 +1,24 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Cwd; +my $cwd = getcwd; +my ($root, $album) = $cwd =~ m{(.*)/photos/(.*)} or die "Cannot identify album from current directory, giving up.\n"; +my $static = "$root/static/gallery/photo/$album"; +-d $static or die "Cannot find generated photos in $static, giving up.\n"; + +print "## Uploading album $album\n"; +system "rs", "$static/", "jw:www/static/gallery/photo/$album/"; +die if $?; + +print "## Pulling at the server\n"; +system "ssh", "jw", "cd web && git pull"; +die if $?; + +print "## Regenerating cache at the server\n"; +system "ssh", "jw", "cd web/photos/$album && ~/web/gal2/gal cache"; +die if $?; + +print "Done.\n";