root/trunk/build/exportmt.pl

Revision 4196, 2.0 kB (checked in by takayama, 3 months ago)

* Set svn keywords

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