File Coverage

blib/lib/Task/Viral.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Task::Viral;
2 1     1   12537 use strict;
  1         4  
  1         52  
3 1     1   5 use warnings;
  1         1  
  1         94  
4              
5             our $VERSION = '0.02.1';
6              
7             1;
8              
9             =encoding utf8
10              
11             =head1 NAME
12              
13             Task::Viral - Conquer hosts with a camel
14              
15             =head1 DESCRIPTION
16              
17             This bundle includes all the stuff you need to build a chain of hosts with Perl installed and CPAN modules you need updated, including your private packages.
18              
19             =head2 WHAT IS AN HOST CHAIN?
20              
21             Suppose you have the following topology.
22              
23             Internet <-- host-1 <-- host-2 <-- ... <-- host-N
24              
25             where C are, for instance, under C<.example.org> domain.
26              
27             Here I call an B an array of hosts, where C is some active CPAN mirror on Internet.
28              
29             The C can connect to C and use it as CPAN mirror.
30              
31             For example, an B could be
32              
33             www.cpan.org <-- development.example.org <-- test.example.org <-- production.example.org
34              
35             where test and production hosts perhaps could not connect to Internet.
36              
37             =head2 SETUP FIRST HOST CHAIN
38              
39             =over 4
40              
41             =item 1
42              
43             Start from C, launch
44              
45             cpan Task::Viral
46              
47             =item 2
48              
49             Create folders for L
50              
51             mkdir -p $HOME/.mcpani/local
52             mkdir -p $HOME/.mcpani/private
53              
54             and write C<$HOME/.mcpani/config> configuration
55              
56             cat < $HOME/.mcpani/config
57             local: $HOME/.mcpani/local
58             remote: http://www.cpan.org
59             repository: $HOME/.mcpani/private
60             passive: yes
61             dirmode: 0755
62             EOF
63              
64             Create your mirror
65              
66             mcpani --mirror -v
67              
68             =item 3
69              
70             Configure L to install from local mirror
71              
72             cpan> o conf urllist file://home/user/.mcpani/local
73             cpan> o conf commit
74              
75             =back
76              
77             =head2 SETUP THE WHOLE HOST CHAIN
78              
79             Start from C.
80              
81             =over 4
82              
83             =item 1
84              
85             Launch a L to serve installed packages to C, for instance on port C<2000>
86              
87             cpanmirrorhttpd --root $HOME/.cpan/sources --port 2000
88              
89             =item 2
90              
91             Login into C and configure L to install packages from C.
92              
93             cpan> o conf urllist http://development.example.org:2000
94             cpan> o conf commit
95              
96             Now you can launch
97              
98             cpan Task::Viral
99              
100             =back
101              
102             and iterate steps on C until last element in the C, in this case C.
103              
104             =head2 ADD YOUR PRIVATE DISTROS
105              
106             Suppose you create some distro on development host, for instance C.
107             You may want to install it on test host as usual
108              
109             cpan My::Package
110              
111             To add your private distros to your B,
112              
113             Create your distro tarball, for instance C, and inject it in your local CPAN
114              
115             mcpani --add --module My::Package --authorid AUTHOR --modversion 0.01 --file ./My-Package-0.01.tar.gz
116              
117             Inject your module
118              
119             mcpani --inject -v
120              
121             =head1 STUFF INCLUDED
122              
123             =over 4
124              
125             =item *
126              
127             L
128              
129             =item *
130              
131             L
132              
133             =item *
134              
135             L
136              
137             =back
138              
139             =head1 SEE ALSO
140              
141             L article by L.
142              
143             =head1 COPYRIGHT AND LICENSE
144              
145             This software is copyright © III Millenium by L.
146              
147             This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
148              
149             =cut
150