| 1 | #!/usr/bin/perl |
|---|
| 2 | |
|---|
| 3 | # Movable Type (r) Open Source (C) 2001-2008 Six Apart, Ltd. |
|---|
| 4 | # This program is distributed under the terms of the |
|---|
| 5 | # GNU General Public License, version 2. |
|---|
| 6 | # |
|---|
| 7 | # $Id$ |
|---|
| 8 | |
|---|
| 9 | use strict; |
|---|
| 10 | use warnings; |
|---|
| 11 | use lib 'build'; |
|---|
| 12 | use Build; |
|---|
| 13 | use Data::Dumper; |
|---|
| 14 | $Data::Dumper::Indent = $Data::Dumper::Terse = $Data::Dumper::Sortkeys = 1; |
|---|
| 15 | |
|---|
| 16 | my $build = Build->new(); |
|---|
| 17 | |
|---|
| 18 | $build->usage() unless @ARGV; |
|---|
| 19 | |
|---|
| 20 | # Get the command-line options. |
|---|
| 21 | $build->get_options(); |
|---|
| 22 | |
|---|
| 23 | # Show the usage if requested. |
|---|
| 24 | $build->usage() if $build->help(); |
|---|
| 25 | |
|---|
| 26 | foreach my $lang ( $build->languages() ) { |
|---|
| 27 | local $build->{'stamp=s'}; |
|---|
| 28 | $build->setup( language => $lang ); |
|---|
| 29 | |
|---|
| 30 | # Summarize what we are about to do. |
|---|
| 31 | $build->verbose( sprintf '* Debug mode is %s and system calls %s be made.', |
|---|
| 32 | $build->debug() ? 'ON' : 'OFF', $build->debug() ? "WON'T" : 'WILL' ); |
|---|
| 33 | $build->verbose( sprintf 'Run options: %s', Dumper $build ) if $build->debug(); |
|---|
| 34 | |
|---|
| 35 | # Get any existing distro with the same path name, out of the way. |
|---|
| 36 | $build->remove_copy(); |
|---|
| 37 | |
|---|
| 38 | # Export the latest files. |
|---|
| 39 | $build->export(); |
|---|
| 40 | |
|---|
| 41 | # Export any plugins that are requested. |
|---|
| 42 | $build->plugin_export(); |
|---|
| 43 | |
|---|
| 44 | # Export any addons that are requested. |
|---|
| 45 | ## $build->addons_export(); |
|---|
| 46 | |
|---|
| 47 | # Add a non-production footer. |
|---|
| 48 | $build->inject_footer(); |
|---|
| 49 | |
|---|
| 50 | # Actually build the distribution files. |
|---|
| 51 | $build->make(); |
|---|
| 52 | |
|---|
| 53 | # Create lists of the distribution paths and uris. |
|---|
| 54 | my $distros = $build->create_distro_list(); |
|---|
| 55 | |
|---|
| 56 | # Deploy the distributions. |
|---|
| 57 | $build->deploy_distros( $distros ); |
|---|
| 58 | |
|---|
| 59 | # Cleanup the exported files. |
|---|
| 60 | $build->cleanup(); |
|---|
| 61 | |
|---|
| 62 | # TODO Factor out the (rarely used) email notification. |
|---|
| 63 | $build->notify( $distros ); |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | __END__ |
|---|
| 67 | |
|---|
| 68 | =head1 NAME |
|---|
| 69 | |
|---|
| 70 | exportmt - Movable Type Export Build Deployment and Notification |
|---|
| 71 | |
|---|
| 72 | =head1 SEE ALSO |
|---|
| 73 | |
|---|
| 74 | https://intranet.sixapart.com/wiki/index.php/Movable_Type:MT_Export-Deploy |
|---|
| 75 | |
|---|
| 76 | The L<Build> (F<build/Build.pm>) module. |
|---|
| 77 | |
|---|
| 78 | =cut |
|---|