Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 139 lines (99 sloc) 4.249 kB
2a1ddaa @miyagawa clarified docs
miyagawa authored
1 NAME
1958242 @miyagawa move Carton.pod to lib
miyagawa authored
2 Carton - Perl module dependency manager (aka Bundler for Perl)
2a1ddaa @miyagawa clarified docs
miyagawa authored
3
4 SYNOPSIS
2b78ae1 @miyagawa update docs
miyagawa authored
5 # On your development environment
2a1ddaa @miyagawa clarified docs
miyagawa authored
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;
2b78ae1 @miyagawa update docs
miyagawa authored
15
2a1ddaa @miyagawa clarified docs
miyagawa authored
16 > carton install
2b78ae1 @miyagawa update docs
miyagawa authored
17 > git add Makefile.PL carton.lock
18 > git commit -m "add Plack and Starman"
2a1ddaa @miyagawa clarified docs
miyagawa authored
19
2b78ae1 @miyagawa update docs
miyagawa authored
20 # Other developer's machine, or on a deployment box
21 > carton install
58bd088 @miyagawa regen README
miyagawa authored
22 > carton exec -Ilib -- starman -p 8080 myapp.psgi
2a1ddaa @miyagawa clarified docs
miyagawa authored
23
24 WARNING
a8c3bed @miyagawa Checking in changes prior to tagging of version v0.9.5.
miyagawa authored
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.
2a1ddaa @miyagawa clarified docs
miyagawa authored
29
30 DESCRIPTION
31 carton is a command line tool to track the Perl module dependencies for
d2e5fe8 @miyagawa update DESCRIPTION
miyagawa authored
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.
2a1ddaa @miyagawa clarified docs
miyagawa authored
36
37 TUTORIAL
38 Initializing the environment
5a31e69 @miyagawa use C<> for filenames
miyagawa authored
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.
2a1ddaa @miyagawa clarified docs
miyagawa authored
42
e2f1bdb @miyagawa misc
miyagawa authored
43 > echo .carton/ >> .gitignore
2a1ddaa @miyagawa clarified docs
miyagawa authored
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
5a31e69 @miyagawa use C<> for filenames
miyagawa authored
50 *Makefile.PL* or *Build.PL*.
2a1ddaa @miyagawa clarified docs
miyagawa authored
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
5a31e69 @miyagawa use C<> for filenames
miyagawa authored
63 The modules are installed into your *local* directory, and the
2a1ddaa @miyagawa clarified docs
miyagawa authored
64 dependencies tree and version information are analyzed and saved into
5a31e69 @miyagawa use C<> for filenames
miyagawa authored
65 *carton.lock* in your directory.
2a1ddaa @miyagawa clarified docs
miyagawa authored
66
5a31e69 @miyagawa use C<> for filenames
miyagawa authored
67 Make sure you add *carton.lock* to your version controlled repository
2b78ae1 @miyagawa update docs
miyagawa authored
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.
2a1ddaa @miyagawa clarified docs
miyagawa authored
71
2b78ae1 @miyagawa update docs
miyagawa authored
72 > git add Makefile.PL carton.lock
73 > git commit -m "Added Plack and Starman"
2a1ddaa @miyagawa clarified docs
miyagawa authored
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
5a31e69 @miyagawa use C<> for filenames
miyagawa authored
81 carton will install these modules into *local* directory in the same
2a1ddaa @miyagawa clarified docs
miyagawa authored
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
5a31e69 @miyagawa use C<> for filenames
miyagawa authored
86 application directory to a remote machine (excluding *local* and
87 *.carton*) and run the following command:
2a1ddaa @miyagawa clarified docs
miyagawa authored
88
89 > carton install
90
5a31e69 @miyagawa use C<> for filenames
miyagawa authored
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
2a1ddaa @miyagawa clarified docs
miyagawa authored
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
5a31e69 @miyagawa use C<> for filenames
miyagawa authored
102 will bundle these tarballs into *local/cache* directory, and
2a1ddaa @miyagawa clarified docs
miyagawa authored
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
84268a0 @miyagawa updated links and homepage metadata
miyagawa authored
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
2a1ddaa @miyagawa clarified docs
miyagawa authored
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.