Deploying code is a pain. You have to track dependencies, keep track of what code goes where for a particular deployment (if you are deploying to multiple targets), and manage versions. The model for managing this pain that I've been introduced to in my first couple of projects at Plain Black has gone something like this:
That works, but it runs into some problems.
What if Joe and I are working on code in separate branches and want to deploy our code? We have to maintain a separate deployment branch (usually trunk) and merge things into there. Ditto if I want to commit some changes to deployed code and don't want to worry about rogue pulls on the target grabbing my (probably unfinished) changes.
I have to look at Joe's code (and every previous developer's code for this client) strewn all over my source tree. This is at best a minor annoyance, but it is still annoying.
I have to run the entire test suite (if I follow WebGUI best practices for testing) every time I make updates -- even testing code that I'm not interacting with, simply because it's part of this client's repository.
My source control tools must be installed on the production server. This can be a major headache, and really isn't necessary.
I have to track dependencies manually or check them into source control. Neither of these is good options, and it's very easy to miss things (whoops, I forgot to install IO::SpecialWidget, now everything's crashing. Argh!)
Fortunately, Perl has a whole culture of tools built around solving these problems for me: CPAN distributions. I can version them, declare dependencies, specify install locations per deployment target, run automated tests just for my application, and keep all of my application components cleanly separated. With a little customization (either Makefile hacking for the brave, or Module::Build subclassing for the lazy), I can set up custom test fixtures (WEBGUI_CONF environment variable?), install WebGUI packages with special actions, and anything else that would bite me in a manual deployment scenario. Deployment is as easy as ./Build dist, copying the tarball to the target, running a configure script, and typing make install. With CPAN.pm, I can even automatically install dependencies!
I'm still working on (and thinking of a name for) a custom Module::Build subclass to handle common WebGUI-ish setups. ./Build install_assets, anyone? Stay tuned for some code, but you can start treating all your WebGUI applications as CPAN dists (and reaping all the benefits) on your own. Please leave comments or send me emails with feature requests for that subclass, too.