I sometimes go into a loop where my workflow contains pushing a distribution several times to application host. I prefer working in the editors on my local machine and not in vi/vim on the application hosts (and then I have to pull back stuff to stick it in CVS).
This takes quite a few commands since I have to push it via a jump host via SSH. So I attempt to make the commands I have in my history as one-linerish as possible so I do not have to skip through several steps.
I have been cursing at Module::Build's ./Build dist
, since it kept prompting me to decide whether I wanted to overwrite the existing tar-ball with the same name, being the product of the command.
gzip even has a force flag!
Today I went back and had a look at the docs and I fell over the --gzip
option.
So now my command looks like this:
% ./Build dist --gzip='/usr/bin/gzip --force'; scp somedistribution-1.00.tar.gz jonasbn@jumphost:~/I a do not have to answer yes everytime I want to deploy a new distribution.
Write your own "Build deploy" action?
# Build.PL
use strict;
use Module::Build;
my $class = Module::Build->subclass(
class => "Module::Build::jonasbn",
code => <<'SUBCLASS', );
sub ACTION_deploy {
my $self = shift;
$self->depends_on('dist'); # create tarball
# add code here to scp
}
SUBCLASS
$class->new( %normal_mb_args )->create_build_script;
Re:Subclass Module::Build
jonasbn on 2008-08-26T07:31:14
I have done several subclasses of Module::Build and I actually already have one for this client, so I could just extend it.
Thanks for the feedback,
jonasbn