Skip to content
This repository
Newer
Older
100644 126 lines (88 sloc) 3.66 kb
2a1ddaa3 »
2011-06-26 clarified docs
1 NAME
1958242d »
2011-06-26 move Carton.pod to lib
2 Carton - Perl module dependency manager (aka Bundler for Perl)
2a1ddaa3 »
2011-06-26 clarified docs
3
4 SYNOPSIS
5 # During the development
6 > cat Makefile.PL
7 use inc::Module::Install;
8 name 'MyApp';
9 version '1.0';
10
11 requires 'Plack', 0.9980;
12 requires 'Starman', 0.2000;
13
14 WriteAll;
15
16 > carton install
17 > git commit -m "add Plack and Starman" Makefile.PL carton.lock
18
19 # Then elsewhere (on a deployment machine)
20 > carton install --deployment
21 > carton exec starman -p 8080 myapp.psgi
22
23 WARNING
24 This software is under the heavy development and considered ALPHA
25 quality till the version hits v1.0.0. Things might be broken, not all
26 features have been implemented, and APIs will be likely to change. YOU
27 HAVE BEEN WARNED.
28
29 DESCRIPTION
30 carton is a command line tool to track the Perl module dependencies for
31 your Perl application.
32
33 TUTORIAL
34 Initializing the environment
35 carton will use ".carton" folder for local configuration and "local" to
36 install modules. You're recommended to exclude these directories from
37 the version control system.
38
39 > carton check
e2f1bdbe »
2011-06-26 misc
40 > echo .carton/ >> .gitignore
2a1ddaa3 »
2011-06-26 clarified docs
41 > echo local/ >> .gitignore
42 > git add carton.lock
43 > git commit -m "Start using carton"
44
45 Tracking the dependencies
46 You can manage the dependencies of your application via the standard
47 "Makefile.PL" or "Build.PL".
48
49 # Makefile.PL
50 use inc::Module::Install;
51 name 'MyAwesomeApp';
52 requires 'Plack', 0.9980;
53 requires 'Starman', 0.2000;
54 WriteAll;
55
56 And then you can install these dependencies via:
57
58 > carton install
59
60 The modules are installed into your "local" directory, and the
61 dependencies tree and version information are analyzed and saved into
62 "carton.lock" in your directory.
63
64 Make sure you add "carton.lock" to your version controlled repository
65 and commit changes as you update dependencies.
66
67 > git commit -m "Added Plack and Starman" Makefile.PL carton.lock
68
69 You can aternatively install modules adhoc from the command line,
70 without managing the build file at all.
71
72 > carton install Devel::NYTProf
73 > carton install AnyEvent::Redis
74
75 carton will install these modules into "local" directory in the same
76 way, and also can track and analyze the dependencies.
77
78 Deploying your application
79 Once you've done installing all the dependencies, you can push your
80 application directory to a remote machine (excluding "local" and
81 ".carton") and run the following command:
82
83 > carton install
84
85 This will look at the "carton.lock" and install the exact same versions
86 of the dependencies into "local", and now your application is ready to
87 run.
88
89 Bundling modules
90 carton can bundle all the tarballs for your dependencies into a
91 directory so that you can even install dependencies that are not
92 available on CPAN, such as internal distribution aka DarkPAN.
93
94 > carton bundle
95
96 will bundle these tarballs into "local/cache" directory, and
97
98 > carton install --cached
99
100 will install modules using this local cache. This way you can avoid a
101 dependency on CPAN meta DB and search.cpan.org at a deploy time, or you
102 can have dependencies onto private CPAN modules aka DarkPAN.
103
104 AUTHOR
105 Tatsuhiko Miyagawa
106
107 COPYRIGHT
108 Tatsuhiko Miyagawa 2011-
109
110 LICENSE
111 This software is licensed under the same terms as Perl itself.
112
113 SEE ALSO
114 cpanm
115
116 Bundler <http://gembundler.com/>
117
118 pip <http://pypi.python.org/pypi/pip>
119
120 npm <http://npmjs.org/>
121
122 perlrocks <https://github.com/gugod/perlrocks>
123
124 only
125
Something went wrong with that request. Please try again.