cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r443187 - /incubator/cayenne/main/trunk/other/cayenne-build-tools/src/main/bin/nightly-build.pl
Date Thu, 14 Sep 2006 01:53:58 GMT
Author: aadamchik
Date: Wed Sep 13 18:53:57 2006
New Revision: 443187

URL: http://svn.apache.org/viewvc?view=rev&rev=443187
Log:
first cut of the maven-based nightly build script; still untested

Modified:
    incubator/cayenne/main/trunk/other/cayenne-build-tools/src/main/bin/nightly-build.pl

Modified: incubator/cayenne/main/trunk/other/cayenne-build-tools/src/main/bin/nightly-build.pl
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/other/cayenne-build-tools/src/main/bin/nightly-build.pl?view=diff&rev=443187&r1=443186&r2=443187
==============================================================================
--- incubator/cayenne/main/trunk/other/cayenne-build-tools/src/main/bin/nightly-build.pl (original)
+++ incubator/cayenne/main/trunk/other/cayenne-build-tools/src/main/bin/nightly-build.pl Wed
Sep 13 18:53:57 2006
@@ -1,16 +1,15 @@
 #!/usr/bin/perl
 
 #
-# Cayenne automated build script. Performs checkout of Cayenne via anonymous CVS,
+# Cayenne automated build script. Performs checkout of Cayenne from SVN,
 # compiles and runs unit tests. Can optionaly notify about the outcome via email
 # as well as upload successful builds to the download server. Used primarily for
 # nightly builds. Requires:
 # 
 #   1. A UNIX box with Perl and mail
-#   2. Ant 1.6
-#   3. JDK 1.4 and JDK 1.5
-#   4. cvs
-#   6. Entry in $HOME/.cayenne/connection.properties for "nightly-test"
+#   2. Maven 2
+#   3. JDK 1.5
+#   4. SVN client
 #
 # Command line:
 #     nightly-build.pl -d svnroot [-u] [-n] [-m email@example.com] 
@@ -18,9 +17,9 @@
 #            -n - skip SVN checkout (used mostly for debugging)
 #            -d - SVN path
 #
-# Crontab:
+# Sample Crontab:
 #
-#     2 5 * * * export CVS_RSH=ssh; /fullpathto/nightly-build.pl -d http://svn.apache.org/repos/asf/incubator/cayenne/main/trunk/cayenne/
[-u] [-m email@example.com]  2>&1 > /dev/null
+#     25 5 * * * (/home/andrus/work/cayenne/other/cayenne-build-tools/src/main/bin/nightly-build.pl
-dhttp://svn.apache.org/repos/asf/incubator/cayenne/main/trunk/ -u -mcayenne-commits@incubator.apache.org)
2>&1 > /dev/null
 #
 
 use strict;
@@ -31,17 +30,12 @@
 
 # set environment dependent vars
 my $base = "$ENV{'HOME'}/work/nightly";
-my $jar_base = "$ENV{'HOME'}/lib";
+my $cayenne_src = "$base/cayenne";
 
 # process command line
 our ($opt_u, $opt_m, $opt_n, $opt_d);
 getopts('unm:d:');
-die_with_email("CVSROOT must be passed using -d option.") unless $opt_d;
-
-# process classpath
-my @cp_lines =  `find -L $jar_base -type f -name \"*.jar\"`;
-chomp(@cp_lines); 
-$ENV{'CLASSPATH'} = join(":", @cp_lines);
+die_with_email("SVN location must be passed using -d option.") unless $opt_d;
 
 `mkdir -p $base`;
 
@@ -52,18 +46,10 @@
 my $out_file = "$base/cayenne-nightly-$label.txt";
 unlink $out_file if -f $out_file;
 
-# Find JDK 1.5 and 1.4 installations...
-my $jdk_15 = "/opt/java-1.5";
-my $jdk_14 = "/opt/java-1.4";
-
-die_with_email("No JDK1.5 installation at $jdk_15") unless -d $jdk_15;
-die_with_email("No JDK1.4 installation at $jdk_14") unless -d $jdk_14;
-
-my $cayenne_src = "$base/cayenne/build";
+# Check for Maven...
+my $mvn = "/usr/bin/mvn";
 
-my $ant = "/usr/bin/ant";
-
-die_with_email("No Ant installation at $ant") unless -f $ant;
+die_with_email("No Maven installation found at $mvn") unless -f $mvn;
 
 # Upload path on the server
 my $rel_path = "/var/sites/objectstyle/html/downloads/cayenne/nightly";
@@ -76,32 +62,17 @@
 get_source();
 
 # build
-chdir "$cayenne_src/cayenne/cayenne-ant" or die_with_email("Can't change to $cayenne_src/cayenne/cayenne-ant:
$!\n");
-
-my $version = release_label();
-
-#
-# Do JDK 1.4 Regression Testing
-# -----------------------------
-$ENV{'JAVA_HOME'} = $jdk_14;
-run_command("$ant help");
-run_command("$ant clean");
-my $status = run_command("$ant test-1_4");
-die_with_email("JDK 1.4 Build failed, return status: $status\n") if $status;
+chdir "$cayenne_src" or die_with_email("Can't change to $cayenne_src: $!\n");
 
 #
-# Build for real with JDK 1.5
+# Build with Maven
 # -----------------------------
-$ENV{'JAVA_HOME'} = $jdk_15;
-run_command("$ant help");
-$status = run_command("$ant clean");
+$status = run_command("$mvn clean install");
 die_with_email("Build failed, return status: $status\n") if $status;
-$status = 
-  run_command("$ant test -Dproject.version=$version -Dcayenne.test.connection=nightly-test
-Dcayenne.test.report=true");
-my $test_failure = $status; 
 
-$status = run_command("$ant release -Dproject.version=$version");
-die_with_email("Build failed, return status: $status\n") if $status;
+chdir "$cayenne_src/assembly" or die_with_email("Can't change to $cayenne_src/assembly: $!\n");
+$status = run_command("$mvn clean install");
+die_with_email("Assembly failed, return status: $status\n") if $status;
 
 # upload
 if($opt_u) {
@@ -110,35 +81,20 @@
 	die_with_email("Can't create release directory, return status: $status\n") if $status;
 	
 	# Upload test results no matter what
-	my $test_reports = "build/tests-report-nightly-test";
-        my $upload_dir = "www.objectstyle.org:$rel_path/$year-$mon-$mday";
-	run_command("chmod -R 755 $test_reports");
-	run_command("rsync -rltp -e ssh --delete --exclude='*.xml' $test_reports/ $upload_dir/reports");
-
-	# Upload status information
-	my $footer;
-	if($test_failure) {
-		$footer = "Nightly build failed some tests, see <a href=\"reports\">test reports</a>
for details.";
-	}
-	else {
-		$footer = "Nightly build passed all tests.";
-	}
-	run_command("ssh www.objectstyle.org 'echo \"$footer\" > $rel_path/$label/FOOTER.html'");
-	
+	#my $test_reports = "build/tests-report-nightly-test";
+    # my $upload_dir = "www.objectstyle.org:$rel_path/$year-$mon-$mday";
+	#run_command("chmod -R 755 $test_reports");
+	#run_command("rsync -rltp -e ssh --delete --exclude='*.xml' $test_reports/ $upload_dir/reports");

 
 	# Upload build even if it failed... 
-	my @gz_files = <dist/*.gz>;
+	my @gz_files = <cayenne-generic/target/assembly/out/*.gz>;
+	die_with_email("Distribution file not found.") unless @gz_files;
+	
 	my $gz_file = $gz_files[0];
-
-	die "Distribution file not found." unless @gz_files;
-	$status = 
-	run_command("scp $gz_files[0] $upload_dir/");
+	$status = run_command("scp $gz_files[0] $upload_dir/");
 	die_with_email("Can't upload release, return status: $status\n") if $status;
 }
 
-die_with_email("Unit tests failed, return status: $status\n") if $test_failure;
-
-
 print_line("====== SUCCESS\n");
 success_email("Build Succeeded.");
 
@@ -162,19 +118,6 @@
 	}
 }
 
-sub release_label() {
-	open(DEFAULT_PROPS, "< default.properties") or die_with_email("Can't open default.properties:
$!\n");
-	while(<DEFAULT_PROPS>) {
-		chomp;
-		if(/^project\.version\s*=\s*(.+)$/) {
-                        return "$1-$label"; 
-		}
-	}
-
-	close(DEFAULT_PROPS);
-	die "Can't find 'project.version' in default.properties";
-}
-
 sub run_command() {
 	my $command = shift;
 	print_line("# $command\n");
@@ -188,7 +131,6 @@
 	close COUT;
 }
 
-
 sub success_email() {
 	my $msg = shift;
 
@@ -202,7 +144,6 @@
 		close(MAIL);   
 	}
 }
-
 
 sub die_with_email() {
 	my $msg = shift;



Mime
View raw message