X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=gal2%2Fbin%2Fgal-mj-upload;h=f33da4242a102c88721ddde1833812edcddb2f8b;hb=cf126a8722526a25290dfe8a68a5c20ca7322d3b;hp=5ce096dcad41274546c36c285d8a3e90011edf0c;hpb=58b154fc9db18054969a3c530f28e6aeadc349a9;p=gallery.git diff --git a/gal2/bin/gal-mj-upload b/gal2/bin/gal-mj-upload index 5ce096d..f33da42 100755 --- a/gal2/bin/gal-mj-upload +++ b/gal2/bin/gal-mj-upload @@ -3,6 +3,14 @@ use strict; use warnings; +print "## Updating Git\n"; +system "git", "pull"; +die if $?; + +print "## Ensuring that photos are generated\n"; +system "gal", "gen"; +die if $?; + use Cwd; my $cwd = getcwd; my ($root, $album) = $cwd =~ m{(.*)/photos/(.*)} or die "Cannot identify album from current directory, giving up.\n"; @@ -13,8 +21,18 @@ print "## Uploading album $album\n"; system "rs", "$static/", "jw:www/static/gallery/photo/$album/"; die if $?; +print "## Calling editor on index files\n"; +system 'vim', 'gallery.cf', "$root/photos/Makefile", "$root/photos/index.thtml"; +die if $?; + +print "## Committing to repository\n"; +system 'git', 'add', 'gallery.cf', 'gallery.list'; die if #?; +system 'git', 'add', "$root/photos/Makefile", "$root/photos/index.thtml"; die if $?; +system 'git', 'commit'; die if $?; +system 'git', 'push'; die if $?; + print "## Pulling at the server\n"; -system "ssh", "jw", "cd web && git pull"; +system "ssh", "jw", "cd web && git pull && make"; die if $?; print "## Regenerating cache at the server\n";