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: pathsToDeploy, filesToDeploy and filesToConvert. You only need one list/table, then derive the individual lists.
In DEPLOYER, do
my %pathsToDeploy; my %filesToDeploy; my @filesToConvert; sub Deploy { my %ToDeploy = @_; %pathsToDeploy = map { $_ => $ToDeploy{$_}->[0] } keys %ToDepl +oy; %filesToDeploy = map { $_ => $ToDeploy{$_}->[1] } keys %ToDepl +oy; @filesToConvert = keys %ToDeploy ); # other code }
Then in your deploy script, you only need:
DEPLOYER::Deploy ( "MY_LAUNCHER_11023200099.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;
|
---|
In Section
Seekers of Perl Wisdom