CPAN For Private Code
Upcoming SlideShare
Loading in...5
×
 

CPAN For Private Code

on

  • 2,638 views

This presentation explores the motivations for and benefits from organizing private code into CPAN-style distributions. It was first given to the San Francisco Perl Mongers in February 2010.

This presentation explores the motivations for and benefits from organizing private code into CPAN-style distributions. It was first given to the San Francisco Perl Mongers in February 2010.

Statistics

Views

Total Views
2,638
Views on SlideShare
2,627
Embed Views
11

Actions

Likes
2
Downloads
13
Comments
1

2 Embeds 11

http://www.slideshare.net 7
https://duckduckgo.com 4

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • That's a nice write up. I linked to it on http://perl-begin.org/topics/cpan/ , and I would also like to mirror it there. Would you please license it under an open media licence such as CC-by or CC-by-sa?

    Regards,

    -- Shlomi Fish
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

CPAN For Private Code CPAN For Private Code Presentation Transcript

  • Jeffrey Thalhammer S o f t w a r e S y s t e m s jeff@imaginative-software.com
  • Using CPAN For Private Code San Francisco Perlmongers February 23, 2010
  • On The Menu Tonight... Reasons To Create CPAN Distros Case Study: Foo Financial Company Assorted Tools You Can Use
  • This presentation was originally titled... Why You Should Create CPAN Distros
  • But it really is about... Why Perl Applications Should Have Build Systems ...and CPAN is just one way to do it.
  • Well, why?
  • Organization! Products Distributions Modules Subroutines Statements
  • A Well-Known Layout A proper place for... scripts libraries tests
  • Dependency Management CPAN.pm Does All The Work Meta-Version Control Detect Circular Dependencies Identify Dependency Flavors: “requires” “build_requires” “configure_requires” “author_requires”
  • Separation Of Concerns Author-time Build-time Install-time Usernames and Passwords Resource Paths Configuration Stuff
  • Sharing And Distribution Easy to identify (i.e. named, versioned) Easy to transport (as *.tar.gz files) Well-known install procedure
  • Tool Chain Support CPAN Module::Build More on this later...
  • Case Study: Foo Financial Company 500k lines of Perl code 100s of scripts, 100s of modules No automated test cases RCS-like version control Quasi-separate DEV and PROD Deploy by manually copying to PROD
  • Havoc Ensued Which files need to be deployed? Which versions of the files? How do I role back? What are the parts of this system? How do changes affect other parts?
  • A Solution: Divide product into Distros. Publish Distros into a private CPAN. Assemble product from private CPAN. Automate everything!
  • SVN CruiseControl commit trunk/ Foo-Reporting/ checkout $ ./Build Foo-Interfaces/ $ ./Build test Foo-Utilities/ Empty Distro. $ ./Build install Simply depends Foo-Everything/ on other top- $ ./Build dist level Foo::* add & Every modules trunk/CPAN/authors/id/F/FOO/ commit commit Foo-Reporting-8.01.tar.gz Foo-Reporting-8.01.tar.gz produces a Distro with a Foo-Interfaces-2.37.tar.gz new version A private CPAN, containing Foo-Utilities-6.01.tar.gz number everything that Foo-Everything-1.02.tar.gz Foo depends on HTTP GET $ cpan Foo-Everything A temporary location, that will /tmp/lib/perl5/site_perl contain all Foo::* installs modules and Foo/Reporting.pm their non-core Foo/Interfaces.pm dependencies Foo-Utilities.pm Finished product! archives Foo-1.45.tar.gz
  • Some Tips: At first, put Everything in one fat Distro. But later, may 1000 Distros bloom! Think about how to name & number versions. Create special accounts for automated jobs. Any SCM and build server will do the job. Know your target Perl environment.
  • Some Supporting Tools CPAN::Mini CPAN::Mini::Inject CPAN::Site Module::Starter Dist::Zilla
  • Jeffrey Thalhammer S o f t w a r e S y s t e m s jeff@imaginative-software.com