From acc7a53bf911dac0723fb3845bd4d0c06fcf497a Mon Sep 17 00:00:00 2001 From: Flavio Poletti Date: Mon, 15 Dec 2014 15:58:53 +0100 Subject: [PATCH] bugfix and more documentation --- deployable | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/deployable b/deployable index df271ab..184515d 100755 --- a/deployable +++ b/deployable @@ -307,7 +307,7 @@ sub add { else { # It's another TAR file to be concatenated for my $item (@$stuff) { my $iterator = Archive::Tar->iter($item); - while (my $f = $iterator->next()) { + while (my $f = $iterator->()) { $tar->add_files($f); } } @@ -477,7 +477,7 @@ You can use deployable. In this case, you can do the following: shell$ cd .. # craft a shell script to be executed remotely and set the exec bit # Suppose it's called deploy.sh - shell$ deployable -o deploy.pl etc deploy.sh --exec deploy.sh + shell$ deployable -o deploy.pl -R etc deploy.sh -d deploy.sh # Now, for each server shell$ scp deploy.pl $server:/tmp @@ -614,7 +614,7 @@ This is useful if you're already building up the absolute deployment layout under a given directory: just treat that directory as if it were the root of the target system. -=item B<< --rootdir | -R > +=item B<< --rootdir | -R >> Include C as a directory that will be extracted under root directory. The actual production procedure is: grab a tarball of @@ -637,6 +637,57 @@ Set the working directory for the deploy. =back +=head1 ROOT OR ROOTDIR? + +There are two options that allow you to specify things to be deployed +in C, so what should you use? Thing is... whatever you want! + +If you have a bunch of directories that have to appear under root, probably +your best bet is to put them all inside a directory called C and +use option C<--root>: + + shell$ mkdir -p myroot/{etc,opt,var,lib,usr,whatever} + # Now put stuff in the directories created above... + shell$ deployable --root myroot ... + +On the other hand, if you just want to put stuff starting from one or +two directories that have to show up in C, you can avoid creating +the extra C directory and use C<--rootdir> instead: + + shell$ mkdir -p etc/whatever + # Now put stuff in etc/whatever... + shell$ deployable --rootdir etc ... + +They are indeed somehow equivalent, the first avoiding you much typing +when you have many directories to be deployed starting from root (just +put them into the same subdirectory), the second allowing you to avoid +putting an extra directory layer. + +There is indeed an additional catch that makes them quite different. When +you use C, the whole content of the directory specified will be +used as a base, so you will end up with a listing like this: + + opt/ + opt/local/ + opt/local/application/ + opt/local/application/myfile.txt + opt/local/application/otherfile.txt + +i.e. all intermediate directories will be saved. On the other hand, when +you specify a directory with C<--rootdir>, you're not limited to provide +a "single-step" directory, so for example: + + shell$ deployable --rootdir opt/local/application + +will result in the following list of files/directories to be stored: + + opt/local/application/ + opt/local/application/myfile.txt + opt/local/application/otherfile.txt + +i.e. the upper level directories will not be included. What is better for +you is for you to judge. + =head1 THE DEPLOY SCRIPT The net result of calling this script is to produce another script, @@ -720,6 +771,14 @@ print configured options and exit set the system C program to use. +=item B<< --tarfile | -F >> + +add the specified C (assumed to be an uncompressed +TAR file) to the lot for root extraction. This can come handy +when you already have all the files backed up in a TAR archive +and you're not willing to expand them (e.g. because your +filesystem is case-insensitive...). + =item B<< --tempdir | --no-tempdir >> by default a temporary directory is created (same as specifying -- 2.11.4.GIT