Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Modernizing a Deploy script to standard distro v5.10.1

by RonW (Parson)
on May 24, 2019 at 18:22 UTC ( #11100485=note: print w/replies, xml ) Need Help??


in reply to Modernizing a Deploy script to standard distro v5.10.1

(Sorry for the delayed reply. I started then got interrupted by an emergency.)

You might also want to consider having DEPLOYER do a little more of the "grunt work".

You have 3 lists of the same files: pathsToDep­loy, filesToDep­loy and filesToCon­vert. You only need one list/table, then derive the individual lists.

In DEPLOYER, do

my %pathsToDep­loy; my %filesToDep­loy; my @filesToCon­vert; sub Deploy { my %ToDep­loy = @_; %pathsToDep­loy = map { $_ => $ToDep­loy{$_}->[0] } keys %ToDep­l +oy; %filesToDep­loy = map { $_ => $ToDep­loy{$_}->[1] } keys %ToDep­l +oy; @filesToCon­vert = keys %ToDep­loy ); # other code }

Then in your deploy script, you only need:

DEPLOYER::Dep­loy ( "MY_LAUNCHER_1102320­0099.sh" => [ '/fancy/deploy/path', 0775 ]­, "fileSanity.pl" => [ '/fancy/deploy/path'­, 0775 ], "transferFile.sh" => [ '/fancy/deploy/path'­, 0775 ], );

This will make the deploy scripts easier to configure because each file is mentioned only once, instead of the 3 times the legacy deploy scripts works and your current new proposal.

Also, as long as DEPLOY.pm has use File::Copy; the deploy scripts only need use DEPLOY;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11100485]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2021-01-24 16:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?