Changeset 708
- Timestamp:
- 10/28/06 09:14:06 (2 years ago)
- Files:
-
- branches/wheeljack/build/Build.pm (modified) (6 diffs)
- branches/wheeljack/build/exportmt.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/wheeljack/build/Build.pm
r702 r708 68 68 'deploy-uri=s' => 'https://intranet.sixapart.com/mt-interest', 69 69 'build!' => 1, # Build distribution files? 70 'email-bcc:s' => undef,71 'email-body=s' => '', # Constructed at run-time.72 'email-cc:s' => undef,73 'email-from=s' => ( $ENV{USER} || $ENV{USERNAME} ) .'@sixapart.com',74 'email-host=s' => 'mail.sixapart.com',75 'email-subject=s' => '', # Constructed at run-time.70 # 'email-bcc:s' => undef, 71 # 'email-body=s' => '', # Constructed at run-time. 72 # 'email-cc:s' => undef, 73 # 'email-from=s' => ( $ENV{USER} || $ENV{USERNAME} ) .'@sixapart.com', 74 # 'email-host=s' => 'mail.sixapart.com', 75 # 'email-subject=s' => '', # Constructed at run-time. 76 76 'export!' => 1, # To export or not to export. That is the question. 77 77 'export-dir=s' => '', # Constructed at run-time. … … 83 83 'ldap' => 0, # Use LDAP (and don't initialize the database). 84 84 'lang=s' => $ENV{BUILD_LANGUAGE} || 'en_US', # de,es,en_US,fr,ja,nl 85 'language=s@' => undef, # Constructed below. 85 86 'local' => 0, # Command-line --option alias 86 87 'make' => 0, # Command-line --option alias for simple legacy `make` … … 120 121 } 121 122 122 # XXX Can't figure out how to pre-define arrays yet.123 123 # Make sure we have an archive file type list. 124 124 $self->{'arch=s@'} ||= [qw( .tar.gz .zip )]; 125 125 # Make the plugins an empty list unless defined. 126 126 $self->{'plugin=s@'} ||= []; 127 # Construct the list of languages to build. 128 $self->{'lang=s'} = 'de,en_US,es,fr,ja,nl' 129 if lc( $self->{'lang=s'} ) eq 'all'; 130 push @{ $self->{'language=s@'} }, split /,/, $self->{'lang=s'}; 127 131 } 128 132 129 133 sub setup { 130 134 my $self = shift; 135 my %args = @_; 131 136 132 137 # Do we have SSL support? … … 159 164 $self->set_repo(); 160 165 161 # Make ab_CD into just ab. 166 # Replace the current language if given one as an argument. 167 $self->{'lang=s'} = $args{language} if $args{language}; 168 # Strip the dialect portion of the language code (ab_CD into ab). 162 169 ($self->{'short-lang=s'} = $self->{'lang=s'}) =~ s/([a-z]{2})_[A-Z]{2}$/$1/o; 163 170 … … 181 188 '%04d%02d%02d', (localtime)[5]+1900, (localtime)[4]+1, (localtime)[3] 182 189 ) if $self->{'date!'}; 190 # Add -ldap to distingush them from Melody Nelson builds. 183 191 push @stamp, 'ldap' if $self->{'ldap'}; 184 192 } … … 793 801 } 794 802 795 sub debug { shift->{'debug'} } 796 sub help { shift->{'help|h'} } 803 sub languages { return @{ shift->{'language=s@'} } } 804 805 sub debug { return shift->{'debug'} } 806 807 sub help { return shift->{'help|h'} } 808 797 809 sub usage { 798 810 my $self = shift; branches/wheeljack/build/exportmt.pl
r702 r708 18 18 $build->usage() if $build->help(); 19 19 20 # Perform some preliminary contextual set-up. 21 $build->setup(); 20 for( $build->languages() ) { 21 # Perform the preliminary contextual set-up. 22 $build->setup( language => $_ ); 22 23 23 # Summarize what we are about to do.24 $build->verbose( sprintf '* Debug mode is %s and system calls %s be made.',25 $build->debug() ? 'ON' : 'OFF', $build->debug() ? "WON'T" : 'WILL' );26 $build->verbose( sprintf 'Run options: %s', Dumper $build ) if $build->debug();24 # Summarize what we are about to do. 25 $build->verbose( sprintf '* Debug mode is %s and system calls %s be made.', 26 $build->debug() ? 'ON' : 'OFF', $build->debug() ? "WON'T" : 'WILL' ); 27 $build->verbose( sprintf 'Run options: %s', Dumper $build ) if $build->debug(); 27 28 28 # Get any existing distro with the same path name, out of the way.29 $build->remove_copy();29 # Get any existing distro with the same path name, out of the way. 30 $build->remove_copy(); 30 31 31 # Export the latest files.32 $build->export();32 # Export the latest files. 33 $build->export(); 33 34 34 # Export any plugins that are requested.35 $build->plugin_export();35 # Export any plugins that are requested. 36 $build->plugin_export(); 36 37 37 # Add a non-production footer.38 $build->inject_footer();38 # Add a non-production footer. 39 $build->inject_footer(); 39 40 40 # Actually build the distribution files with make.41 $build->make();41 # Actually build the distribution files. 42 $build->make(); 42 43 43 # Create lists of the distribution paths and uris.44 my $distros = $build->create_distro_list();44 # Create lists of the distribution paths and uris. 45 my $distros = $build->create_distro_list(); 45 46 46 # Deploy the distributions.47 $build->deploy_distros( $distros );47 # Deploy the distributions. 48 $build->deploy_distros( $distros ); 48 49 49 # Cleanup the exported files.50 $build->cleanup();50 # Cleanup the exported files. 51 $build->cleanup(); 51 52 52 # Send email notification. 53 $build->notify( $distros ); 53 # TODO Refactor the (rarely used) email notification. 54 $build->notify( $distros ); 55 } 54 56 55 exit; 57 __END__ 58 59 =head1 NAME 60 61 exportmt - Movable Type Export Build Deployment and Notification 62 63 =head1 SEE ALSO 64 65 https://intranet.sixapart.com/wiki/index.php/Movable_Type:MT_Export-Deploy 66 67 The L<Build> (F<build/Build.pm>) module. 68 69 =cut
