Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by RonW (Parson)
on May 24, 2019 at 18:22 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11100485]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found