don't background the editor if we are not under X
[sgn-devtools.git] / sgn_deploy
blobfe54a90fd126be6b5c27fe4752eab1b237ee619c
1 #!/usr/bin/env perl
3 use Modern::Perl;
4 use autodie qw/:all/;
6 =head1 sgn_deploy - Deploy SGN site to current host
8 Use this script to deploy an already-created sgn-site debian package to the local machine.
10 This script requires "sudo" access.
12 =cut
14 my ($deb) = @ARGV;
16 die "Must specify path to debian package to deploy!" unless $deb;
17 die "$deb does not exist!" unless -e $deb;
19 my $pkg = $deb;
20 $pkg =~ s/\.deb$//;
22 my $email = 'cxgn-devel@sgn.cornell.edu';
23 my $cmd =<<CMD;
24 sudo dpkg -i $deb && sudo /etc/init.d/apache2 restart && mail -s "`hostname -s` updated to `basename $pkg`" $email < $pkg.changes
25 CMD
27 print "Deploying $deb with following command:\n$cmd\n";
29 system $cmd;