aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cummi...@apache.org
Subject svn commit: r1380313 [1/4] - in /aries: scripts/ site/trunk/content/development/ site/trunk/content/downloads/ trunk/
Date Mon, 03 Sep 2012 19:31:59 GMT
Author: cumminsh
Date: Mon Sep  3 19:31:59 2012
New Revision: 1380313

URL: http://svn.apache.org/viewvc?rev=1380313&view=rev
Log:
[ARIES-862] Update downloads page with 1.0.0 bundles, and improvements to scripts for generating
download page and mirroring releases to dist directory, and release instructions update.

Removed:
    aries/trunk/aries_release_versions.txt
Modified:
    aries/scripts/create_modules_table.pl
    aries/scripts/download_release_artifacts.pl
    aries/site/trunk/content/development/releasingaries.mdtext
    aries/site/trunk/content/downloads/README
    aries/site/trunk/content/downloads/currentrelease.mdtext
    aries/site/trunk/content/downloads/currentrelease.mdtext_body
    aries/site/trunk/content/downloads/modules_table.txt

Modified: aries/scripts/create_modules_table.pl
URL: http://svn.apache.org/viewvc/aries/scripts/create_modules_table.pl?rev=1380313&r1=1380312&r2=1380313&view=diff
==============================================================================
--- aries/scripts/create_modules_table.pl (original)
+++ aries/scripts/create_modules_table.pl Mon Sep  3 19:31:59 2012
@@ -1,17 +1,11 @@
 #!/usr/bin/perl
 #
-# Generate a release table row for each bundle to be released
-# Needs a text file called aries_release_versions.txt. This needs to be updated with the
-# right version information before running the script.
+# Generate a release table row for each bundle to be released.
+# We assume we want the most recent version of anything in the dist directory on minotaur.
 #
 
-$release_file = @ARGV[0];
-
-if (!-f $release_file) {
-         print "\nUsage: perl create_modules_table.pl aries_release_versions.txt \n\n";
-         exit;
-}
-
+use LWP::Simple;
+use HTML::TokeParser;
 
 # Distribution directories
 $cgi = "http://www.apache.org/dyn/closer.cgi/aries/";
@@ -31,32 +25,51 @@ $c_asc = "\">asc</A>";
 $c_md5 = "\">md5</A>";
 $c_sha1 = "\">sha1</A>";
 
-open (MOD, "aries_release_versions.txt");
+my $data = get($dist);
+my $html = HTML::TokeParser->new(\$data);
 
-print $open_tr.$open_th." Sub project ".$close_th.$open_th." Module ".$close_th.$open_th."
Version ".$close_th.$open_th." Binary ".$close_th.$open_th." Source ".$close_th.$open_th."
Buildable src ".$close_th.$open_th." Comments ".$close_th.$close_tr."\n"; 
+my @hrefs = ();
+my @versions = ();
 
-while (<MOD>) {
-    if (/Module: (\w+)/i) {
-        $module = $1;
-        print_module_header();
-        # print "$module \n";
-        while (<MOD>) {
-            last if (/ModuleEnd/i); 
-            next if (/^#/);
-            chomp;
-            ($bundle, $version) = split(/,/, $_); 
-            print_table_row();
-         #    print "$bundle $version \n";
-       } 
-    }
+my %links = ();
+my @archives = ();
+
+while (my $token = $html->get_tag("a")) {
+	my $href = $token->[1]{href} || "-";
+# TODO eba-maven plugin and samples 
+# This pattern doesn't catch blueprint-parser but it's not an independent bundle so that's
ok
+	
+ 	if ($href =~ /(org.apache.aries.([^\.]*)\..*)-([0-9\.]+)(\.jar|-sources.jar|-source-release.zip)$/)
{
+		my($component) = $2;
+		my($bundle) = $1;
+		my($version) = $3;
+		my($extension) = $4;
+		# Only take the highest version 
+		if ($version > $links{$component}{$bundle}) {
+			 $links{$component}{$bundle}=$version;
+		}
+		# Make a note of the link so we know what sort of archives we have
+		push(@archives,$href);
+	}
 }
 
-foreach $keys (%bundle_info) {
-    print;
+print "<!-- This page can be automatically generated from the dist directory using the
create_modules_table.pl script -->";
+
+print $open_tr.$open_th." Sub project ".$close_th.$open_th." Module ".$close_th.$open_th."
Version ".$close_th.$open_th." Binary ".$close_th.$open_th." Source ".$close_th.$open_th."
Buildable src ".$close_th.$open_th." Comments ".$close_th.$close_tr."\n"; 
+
+for $component ( sort keys %links ) {
+	print_component_header();
+	for $bundle ( sort keys %{ $links{$component} } ) {
+		$version = $links{$component}{$bundle};
+		print_table_row();
+	    }
+    print "\n";
 }
 
-sub print_module_header {
-    print $open_tr.$open_td." ".$module." ".$close_td.$open_td.$close_td.$open_td." - ".$close_td.$open_td."
- " .$close_td.$open_td." - ".$close_td.$open_td." - ".$close_td.$open_td.$close_td.$close_tr."\n";
+print "</table>";
+
+sub print_component_header {
+    print $open_tr.$open_td." ".$component." ".$close_td.$open_td.$close_td.$open_td." -
".$close_td.$open_td." - " .$close_td.$open_td." - ".$close_td.$open_td." - ".$close_td.$open_td.$close_td.$close_tr."\n";
 }
 
 
@@ -67,16 +80,17 @@ sub print_table_row {
     $md5 = $bundle."-".$version.".jar.md5";
     $sha1 = $bundle."-".$version.".jar.sha1";
 
-    $s_jar = $bundle."-".$version.".sources.jar";
-    $s_asc = $bundle."-".$version.".sources.jar.asc";
-    $s_md5 = $bundle."-".$version.".sources.jar.md5";
-    $s_sha1 = $bundle."-".$version.".sources.jar.sha1";
+    $s_jar = $bundle."-".$version."-sources.jar";
+    $s_asc = $bundle."-".$version."-sources.jar.asc";
+    $s_md5 = $bundle."-".$version."-sources.jar.md5";
+    $s_sha1 = $bundle."-".$version."-sources.jar.sha1";
 
     $bs_zip = $bundle."-".$version."-source-release.zip";
     $bs_asc = $bundle."-".$version."-source-release.zip.asc";
     $bs_md5 = $bundle."-".$version."-source-release.zip.md5";
     $bs_sha1 = $bundle."-".$version."-source-release.zip.sha1";
 
+	if ($jar ~~ @archives) {
     $line1 = $ar.$cgi.$jar.$c_jar.
              " (".
              $ar.$dist.$asc.$c_asc.
@@ -85,7 +99,11 @@ sub print_table_row {
              ", ".
              $ar.$dist.$sha1.$c_sha1.
              ")";
+    } else {
+      $line1 = " - ";
+    }
 
+	if ($s_jar ~~ @archives) {
     $line2 = $ar.$cgi.$s_jar.$c_jar.
              " (".
              $ar.$dist.$s_asc.$c_asc.
@@ -94,10 +112,11 @@ sub print_table_row {
              ", ".
              $ar.$dist.$s_sha1.$c_sha1.
              ")";
-             
-             
-    if ($bundle =~ /^org\.apache\.aries\.(blueprint|jndi|proxy|quiesce\.manager|testsupport\.unit|util)/)
{
-
+    } else {
+      $line2 = " - ";
+    }
+            
+	if ($bs_zip ~~ @archives) {
       $line3 = $ar.$cgi.$bs_zip.$c_zip.
                " (".
                $ar.$dist.$bs_asc.$c_asc.

Modified: aries/scripts/download_release_artifacts.pl
URL: http://svn.apache.org/viewvc/aries/scripts/download_release_artifacts.pl?rev=1380313&r1=1380312&r2=1380313&view=diff
==============================================================================
--- aries/scripts/download_release_artifacts.pl (original)
+++ aries/scripts/download_release_artifacts.pl Mon Sep  3 19:31:59 2012
@@ -1,19 +1,88 @@
 #!/bin/perl
 #
-# Generate a script to download release artifacts.
-#
+# Generate a script to download release artifacts. 
+# Usage: perl download_release_artifacts.pl [target version] [filters ...]
+# If no arguments are specified, the whole Aries section of the Apache
+# repository is included. Any number of regular expression can be specified to narrow down
what's included. 
+# If no version is 
+# specified, the highest version is used; otherwise only the specified version is transferred.

+# Example: perl download_release_artifacts.pl 1.0.0 application modeller | tee download.sh
+
+use LWP::Simple;
+use HTML::TokeParser;
+
+@filters = ();
+
+# Arguments are assumed to be regexps unless they're numeric versions
+foreach my $arg (@ARGV) {
+	if ($arg =~ /^[0-9\.]+$/) {   
+		$target_version="$arg\/";
+		print "# Targetting version $target_version\n"
+	} else {
+		push(@filters, $arg);
+	}
+ 
+}
+
+$from_repository = "https://repository.apache.org/content/repositories/releases/org/apache/aries";
 
-$release_file = @ARGV[0];
+crawl($from_repository);
 
-if (!-f $release_file) {
-        print "\nUsage: perl download_release_artifacts.pl aries_release_versions.txt \n\n";
-            exit;
+sub crawl {
+	my $url = @_[0];
+	print "# Crawling $url\n";
+	my $data = get($url);
+	my $html = HTML::TokeParser->new(\$data);
+	 
+	my @hrefs = ();
+	my @versions = ();
+
+	while (my $token = $html->get_tag("a")) {
+	    my $href = $token->[1]{href} || "-";
+	    my $text = $html->get_trimmed_text("/a");
+	    
+
+	# If this is a directory link ... 
+	if ($href =~ /http.*\/$/) {
+		# If this is a version of this module ...
+		if ($text =~ /^[0-9\.]+\/$/) {
+			if ((! defined $target_version) || $text eq $target_version) {
+				push(@versions, $href);
+			}
+			} else {
+				push(@hrefs, $href);
+			}
+		}
+	}
+
+	# If no version is specified, choose the maximum 
+	@versions = sort(@versions);
+	my $len = scalar @versions;
+	 
+	if ($len > 0) {
+		# Check we meet all the filters 
+		my $matches = true;
+		foreach $filter (@filters) {
+			$matches = $matches && (@versions[$#versions] =~ $filter);
+		}
+		if ($matches) {
+			do_downloads(@versions[$#versions]);
+		}
+	}
+
+	# Recurse
+	for my $link (@hrefs) {
+	    crawl($link)
+	}
 }
 
 
-$from_repository = "https://repository.apache.org/content/repositories/releases/org/apache/aries";
-
-@file_types = (
+sub do_downloads {
+	my $url = @_[0];
+       	my @folders = split(/\//, $url);
+        my $bundle = @folders[$#folders - 1];
+        my $version = @folders[$#folders];
+	@file_types = (
               "",
               ".md5",
               ".asc",
@@ -21,34 +90,15 @@ $from_repository = "https://repository.a
               ".asc.md5",
               ".asc.sha1"
               );
+	foreach $ft (@file_types) {
+		print "wget -N --no-check-certificate $url/$bundle-$version.jar$ft\n";
+		print "wget -N --no-check-certificate $url/$bundle-$version-sources.jar$ft\n";
+		print "wget -N --no-check-certificate $url/$bundle-$version-source-release.zip$ft\n";
+		print "wget -N --no-check-certificate $url/$bundle-$version-javadoc.jar$ft\n";
+	}
+}
+
+
 
-open (MOD, $release_file);
 
-while (<MOD>) {
-    if (/Module: (\w+)/i) {
-    $module = $1;
-  #
-  # Special case util
-  #
-    if ($module =~ /util/i ) {
-        $module = "";
-    } 
-    while (<MOD>) {
-       last if (/ModuleEnd/i);
-       next if (/^#/);
-       chomp;
-       ($bundle, $version) = split(/,/, $_);
-       print_row();
-       # print "$bundle $version \n";
-    }
-  }
-}
-sub print_row {
-  foreach $ft (@file_types) {
-     print "wget -N --no-check-certificate $from_repository/$module/$bundle/$version/$bundle-$version.jar$ft\n";
-     print "wget -N --no-check-certificate $from_repository/$module/$bundle/$version/$bundle-$version-sources.jar$ft\n";
-     print "wget -N --no-check-certificate $from_repository/$module/$bundle/$version/$bundle-$version-source-release.zip$ft\n";
-     print "wget -N --no-check-certificate $from_repository/$module/$bundle/$version/$bundle-$version-javadoc.jar$ft\n";
-  }
-}
 

Modified: aries/site/trunk/content/development/releasingaries.mdtext
URL: http://svn.apache.org/viewvc/aries/site/trunk/content/development/releasingaries.mdtext?rev=1380313&r1=1380312&r2=1380313&view=diff
==============================================================================
--- aries/site/trunk/content/development/releasingaries.mdtext (original)
+++ aries/site/trunk/content/development/releasingaries.mdtext Mon Sep  3 19:31:59 2012
@@ -23,14 +23,7 @@ a release of the blueprint API bundle is
 its -SNAPSHOT dependencies. Because Aries bundles are quite interdependent (see [here](moduledependencies)

 for an idea
 of how the modules relate to each other, it may be necessary to release quite a large number
of bundles. So,
-step one is to make a list. 
-<p>To help with this, there is a file called aries_release_versions.txt in the top
level
-aries directory - this contains a list of all the Aries modules and their current release
versions. The file
-can be recreated (if necessary)
-using the perl script list_bundles_in_aries.pl, checked into SVN under the scripts directory.
The text file
-is used for later steps in the release process, so by the end of the process it will have
been updated to have
-a complete list
-of all Aries modules and their most recent version numbers after the release.</p>
+step one is to make a list.  
 
 
 ### Choosing a strategy for the release
@@ -106,15 +99,12 @@ work together.
 ## Releasing the samples
 
 The Aries samples are designed to work across all the Aries modules. Samples are released
as a single
-module. All of the Aries dependencies are listed in the top level samples pom. In 
-trunk, the version of all the dependencies should always point the SNAPSHOT versions 
-in trunk. At release time these must all be modified to the latest released version of 
-each bundle. *It is very important the versions are set **only** in the top level 
+module. All of the Aries dependencies are listed in the top level samples pom. 
+*It is very important the versions are set **only** in the top level 
 sample pom*. Both sub-modules and filtered resources need the version information, setting
it in
 one place is the only way to avoid a mess.
 
-<p>The best time to do a samples release is usually at the end of a bundle release
when 
-all of the bundle version information is up to date in aries_release_versions.txt. </p>
+<p>The best time to do a samples release is usually at the end of a bundle release.
</p>
 
 <p>It is critically important that the samples are all tested before making release.
Some have itests
 but others (blueprint) are only tested manually. In fact it's wise to run through
@@ -375,9 +365,6 @@ After 72 hours, if no problems have been
 the dev@aries vote can be summarised and closed. Note that at least three
 +1 votes from Aries PMC members are required. 
 
-Finally - ensure that the file aries_release_version.txt is completely up to date and accurate.

-You will use this file in the following steps to help build the release web pages.
-
 
 <a name="ReleasingAries-Promotingthereleaseartifacts"></a>
 ### Promoting the release artifacts
@@ -395,10 +382,10 @@ archived here /www/archive.apache.org/di
 
 First, delete the artifacts of the previous release from the distribution directory. You
don't need to worry about putting the previous release artifacts in the archive as they will
already have been rsync'd from the distribution directory.
 
-Then, put new release artifacts in the distribution directory. This is best done using a
script, the script can be generated uing
+Then, put new release artifacts in the distribution directory. This is best done using a
script, the script can be generated using
 the perl script [download_release_artifacts.pl](http://svn.apache.org/repos/asf/aries/scripts/download_release_artifacts.pl).

 
-Next, update the Aries Downloads pages to refer to the new artifacts.
+Next, update the Aries Downloads pages to refer to the new artifacts. The the perl script
[create_modules_table.pl](http://svn.apache.org/repos/asf/aries/scripts/create_modules_table.pl)
can do this automatically.
 
 ### Updating dependencies
 

Modified: aries/site/trunk/content/downloads/README
URL: http://svn.apache.org/viewvc/aries/site/trunk/content/downloads/README?rev=1380313&r1=1380312&r2=1380313&view=diff
==============================================================================
--- aries/site/trunk/content/downloads/README (original)
+++ aries/site/trunk/content/downloads/README Mon Sep  3 19:31:59 2012
@@ -9,7 +9,7 @@ Steps to generate:
 
 1. Edit the file aries-release-versions.txt to get the right release versions.
 2. Run 'perl create_modules_table.pl > modules_table.txt'
-3. Edit current_release.mdtext_body to insert modules_table.txt just before teh final </table>
-4  Copy current_release.mdtext_body to current_release.mdtext and checkin
+3. Run 'cat currentrelease.mdtext_body modules_table.txt > currentrelease.mdtext'
+4. Commit and publish 
 
 



Mime
View raw message