Skip to content
This repository
Newer
Older
100644 139 lines (99 sloc) 4.249 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
2b78ae10 »
2011-06-26 update docs
5 # On your development environment
2a1ddaa3 »
2011-06-26 clarified docs
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;
2b78ae10 »
2011-06-26 update docs
15
2a1ddaa3 »
2011-06-26 clarified docs
16 > carton install
2b78ae10 »
2011-06-26 update docs
17 > git add Makefile.PL carton.lock
18 > git commit -m "add Plack and Starman"
2a1ddaa3 »
2011-06-26 clarified docs
19
2b78ae10 »
2011-06-26 update docs
20 # Other developer's machine, or on a deployment box
21 > carton install
58bd088e »
2012-03-31 regen README
22 > carton exec -Ilib -- starman -p 8080 myapp.psgi
2a1ddaa3 »
2011-06-26 clarified docs
23
24 WARNING
a8c3bedf »
2012-04-12 Checking in changes prior to tagging of version v0.9.5.
25 This software is under heavy development and considered ALPHA quality
26 till its version hits v1.0.0. Things might be broken, not all features
27 have been implemented, and APIs are likely to change. YOU HAVE BEEN
28 WARNED.
2a1ddaa3 »
2011-06-26 clarified docs
29
30 DESCRIPTION
31 carton is a command line tool to track the Perl module dependencies for
d2e5fe86 »
2011-06-26 update DESCRIPTION
32 your Perl application. The managed dependencies are tracked in a
33 *carton.lock* file, which is meant to be version controlled, and the
34 lock file allows other developers of your application will have the
35 exact same versions of the modules.
2a1ddaa3 »
2011-06-26 clarified docs
36
37 TUTORIAL
38 Initializing the environment
5a31e692 »
2011-06-26 use C<> for filenames
39 carton will use the *.carton* directory for local configuration and the
40 *local* directory to install modules into. You're recommended to exclude
41 these directories from the version control system.
2a1ddaa3 »
2011-06-26 clarified docs
42
e2f1bdbe »
2011-06-26 misc
43 > echo .carton/ >> .gitignore
2a1ddaa3 »
2011-06-26 clarified docs
44 > echo local/ >> .gitignore
45 > git add carton.lock
46 > git commit -m "Start using carton"
47
48 Tracking the dependencies
49 You can manage the dependencies of your application via the standard
5a31e692 »
2011-06-26 use C<> for filenames
50 *Makefile.PL* or *Build.PL*.
2a1ddaa3 »
2011-06-26 clarified docs
51
52 # Makefile.PL
53 use inc::Module::Install;
54 name 'MyAwesomeApp';
55 requires 'Plack', 0.9980;
56 requires 'Starman', 0.2000;
57 WriteAll;
58
59 And then you can install these dependencies via:
60
61 > carton install
62
5a31e692 »
2011-06-26 use C<> for filenames
63 The modules are installed into your *local* directory, and the
2a1ddaa3 »
2011-06-26 clarified docs
64 dependencies tree and version information are analyzed and saved into
5a31e692 »
2011-06-26 use C<> for filenames
65 *carton.lock* in your directory.
2a1ddaa3 »
2011-06-26 clarified docs
66
5a31e692 »
2011-06-26 use C<> for filenames
67 Make sure you add *carton.lock* to your version controlled repository
2b78ae10 »
2011-06-26 update docs
68 and commit changes as you update dependencies. This will ensure that
69 other developers on your app, as well as your deployment environment,
70 use exactly the same versions of the modules you just installed.
2a1ddaa3 »
2011-06-26 clarified docs
71
2b78ae10 »
2011-06-26 update docs
72 > git add Makefile.PL carton.lock
73 > git commit -m "Added Plack and Starman"
2a1ddaa3 »
2011-06-26 clarified docs
74
75 You can aternatively install modules adhoc from the command line,
76 without managing the build file at all.
77
78 > carton install Devel::NYTProf
79 > carton install AnyEvent::Redis
80
5a31e692 »
2011-06-26 use C<> for filenames
81 carton will install these modules into *local* directory in the same
2a1ddaa3 »
2011-06-26 clarified docs
82 way, and also can track and analyze the dependencies.
83
84 Deploying your application
85 Once you've done installing all the dependencies, you can push your
5a31e692 »
2011-06-26 use C<> for filenames
86 application directory to a remote machine (excluding *local* and
87 *.carton*) and run the following command:
2a1ddaa3 »
2011-06-26 clarified docs
88
89 > carton install
90
5a31e692 »
2011-06-26 use C<> for filenames
91 This will look at the *carton.lock* and install the exact same versions
92 of the dependencies into *local*, and now your application is ready to
2a1ddaa3 »
2011-06-26 clarified docs
93 run.
94
95 Bundling modules
96 carton can bundle all the tarballs for your dependencies into a
97 directory so that you can even install dependencies that are not
98 available on CPAN, such as internal distribution aka DarkPAN.
99
100 > carton bundle
101
5a31e692 »
2011-06-26 use C<> for filenames
102 will bundle these tarballs into *local/cache* directory, and
2a1ddaa3 »
2011-06-26 clarified docs
103
104 > carton install --cached
105
106 will install modules using this local cache. This way you can avoid a
107 dependency on CPAN meta DB and search.cpan.org at a deploy time, or you
108 can have dependencies onto private CPAN modules aka DarkPAN.
109
84268a08 »
2011-06-26 updated links and homepage metadata
110 COMMUNITY
111 <https://github.com/miyagawa/carton>
112 Code repository, Wiki and Issue Tracker
113
114 <irc://irc.perl.org/#carton>
115 IRC chat room
116
2a1ddaa3 »
2011-06-26 clarified docs
117 AUTHOR
118 Tatsuhiko Miyagawa
119
120 COPYRIGHT
121 Tatsuhiko Miyagawa 2011-
122
123 LICENSE
124 This software is licensed under the same terms as Perl itself.
125
126 SEE ALSO
127 cpanm
128
129 Bundler <http://gembundler.com/>
130
131 pip <http://pypi.python.org/pypi/pip>
132
133 npm <http://npmjs.org/>
134
135 perlrocks <https://github.com/gugod/perlrocks>
136
137 only
138
Something went wrong with that request. Please try again.