#!/usr/bin/perl use strict; use warnings; 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"; 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";