commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r438239 - /jakarta/commons/proper/commons-build/trunk/commons_nightly.sh
Date Tue, 29 Aug 2006 21:47:13 GMT
Author: psteitz
Date: Tue Aug 29 14:47:13 2006
New Revision: 438239

URL: http://svn.apache.org/viewvc?rev=438239&view=rev
Log:
Added maven 2 support.

Modified:
    jakarta/commons/proper/commons-build/trunk/commons_nightly.sh

Modified: jakarta/commons/proper/commons-build/trunk/commons_nightly.sh
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/commons-build/trunk/commons_nightly.sh?rev=438239&r1=438238&r2=438239&view=diff
==============================================================================
--- jakarta/commons/proper/commons-build/trunk/commons_nightly.sh (original)
+++ jakarta/commons/proper/commons-build/trunk/commons_nightly.sh Tue Aug 29 14:47:13 2006
@@ -3,19 +3,23 @@
 # Jakarta Commons Nightly Build
 #
 # Executes "svn up" and then "ant clean dist" for all of the
-# components in $nightly_list_location/nightly_proper_ant_list.txt
-# and "maven clean dist" for those in 
-# $nightly_list_location/nightly_proper_maven_list.txt. 
+# components in $nightly_list_location/nightly_proper_ant_list.txt,
+# "maven clean dist" for those in 
+# $nightly_list_location/nightly_proper_maven_list.txt and
+# mvn assembly:assembly -DdescriptorId=bin (then src) for components in
+# $nightly_list_location/nightly_proper_maven2_list.txt
 # Similarly for sandbox components from the *_sandbox_* lists.
 #
 # Uses scp to upload resulting .zip and .tar.gz files to
 # $deploy_user@$deploy_host:$deploy_location/commons-$component
 #
-# Deploys dated snapshot jars for the maven components to
-# $maven_snapshot_host:$maven_snapshot_directory
+# Deploys dated snapshot jars for the maven 1 components to
+# $maven_snapshot_host:$maven_snapshot_directory and uses
+# "mvn deploy" to deploy maven 2 jars to the snapshot repo configured
+# in the pom.
 #
 # Names of distro files take the form 
-# commons-$component-src-$time_stamp (source)
+# commons-$component-$time_stamp-src (source)
 # commons-$component-$time_stamp (binaries)
 #
 # (Over-)writes a log for each component build to $log_location/$component.log
@@ -45,22 +49,31 @@
 log_url=http://people.apache.org/~psteitz/commons-nightlies
 notification_email=commons-dev@jakarta.apache.org
 #==============================================================================
+# Function definitions
+#==============================================================================
+# Check to make sure current component checkout exists locally and if it is
+# missing, execute "svn up" from the current root
+#==============================================================================
+verify_checkout() {
+  if [ ! -e "${current_root}/${component}" ]  # Check if checkout exists.
+  then
+    echo "$component checkout is missing."
+    echo "Updating top level checkout..."
+    cd $current_root
+    svn up
+  fi
+}
+#==============================================================================
 # Process maven components in $components list.
 # Assumes $components are checked out with common root, $current_root
 #==============================================================================
 process_maven_components() {
   for component in $components
   do
-    if [ ! -e "${current_root}/${component}" ]  # Check if checkout exists.
-    then
-      echo "$component checkout is missing."
-      echo "Updating top level checkout..."
-      cd $current_root
-      svn up
-    fi
+    verify_checkout
     cd ${current_root}/${component}
     echo
-    echo "Using Maven to build $component...."
+    echo "Using Maven 1 to build $component...."
     svn up
 
     # Create distro, overriding version name with timestamp
@@ -113,19 +126,61 @@
   done 
 } 
 #==============================================================================
+# Process maven 2 components in $components list.
+# Assumes $components are checked out with common root, $current_root
+#==============================================================================
+process_maven2_components() {
+  for component in $components
+  do
+    verify_checkout
+    cd ${current_root}/${component}
+    echo
+    echo "Using Maven 2 to build $component...."
+    svn up
+
+    # Create source and binary distributions
+    mvn clean
+    mvn assembly:assembly -DdescriptorId=bin > $log_location/$component.log 2>&1

+    mvn assembly:assembly -DdescriptorId=src 
+    # Rename files
+    mv target/commons-$component*bin.tar.gz target/commons-$component-$time_stamp.tar.gz
+    mv target/commons-$component*src.tar.gz target/commons-$component-$time_stamp-src.tar.gz
+    mv target/commons-$component*bin.zip target/commons-$component-$time_stamp.zip
+    mv target/commons-$component*src.zip target/commons-$component-$time_stamp-src.zip
+
+    # Deploy source and binary distro to commons nightly location
+    ssh $deploy_host mkdir -p $deploy_location/commons-$component
+    scp target/distributions/commons-$component*.gz \
+    $deploy_user@$deploy_host:$deploy_location/commons-$component
+    scp target/distributions/commons-$component*.zip \
+    $deploy_user@$deploy_host:$deploy_location/commons-$component
+    scp target/distributions/commons-$component*.md5 \
+    $deploy_user@$deploy_host:$deploy_location/commons-$component
+
+    # Deploy dated jar to maven 2 snapshot repo (configured in apache pom)
+    if [ -e "target/commons-$component*.jar" ] # build succeeded
+    then 
+       mvn deploy
+    else # build failed - add to failure list and capture unit test logs
+      failed_builds[${#failed_builds[@]}]=$component
+      echo "Test Reports" >> $log_location/$component.log
+      for i in "target/surefire-reports/*.txt"; do
+        cat $i >> $log_location/$component.log
+      done
+    fi
+
+    # Cleanup
+    rm -rf target                                      
+  done 
+} 
+#==============================================================================
 # Process ant components in $components list.
 # Assumes $components are checked out with common root, $current_root
 #==============================================================================
 process_ant_components() {
   for component in $components
   do
-    if [ ! -e "${current_root}/${component}" ]  # Check if checkout exists.
-    then
-      echo "$component checkout is missing."
-      echo "Updating top level checkout..."
-      cd $current_root
-      svn up
-    fi
+    verify_checkout
     cd ${current_root}/${component}
     echo
     echo "Using Ant to build $component...."
@@ -171,13 +226,23 @@
     rm -rf ${ant_build}/commons-$component-src
   done 
 } 
-
+#==============================================================================
+# Main
+#==============================================================================
 echo "Commons nightly build starting: `date`"
 
 # Update commons-build
 cd $proper_root/commons-build
 svn up
 
+# Update and install commons m2 poms - drop this when they are released
+cd $proper_root
+svn up pom.xml
+mvn -N install
+cd $sandbox_root
+svn up pom.xml
+mvn -N install
+
 # Set umask
 umask 002
 
@@ -200,6 +265,16 @@
 echo "=========================================="
 process_maven_components
 
+# Proper Maven 2 components
+list_file="$nightly_list_location/nightly_proper_maven2_list.txt"
+components=`<$list_file`
+current_root=$proper_root
+echo
+echo "=========================================="
+echo "Building Commons Proper Maven 2 Components"
+echo "=========================================="
+process_maven2_components
+
 # Sandbox Ant components
 list_file="$nightly_list_location/nightly_sandbox_ant_list.txt"
 components=`<$list_file`
@@ -220,8 +295,21 @@
 echo "=========================================="
 process_maven_components
 
-# Make files group writable
+# Sandbox Maven 2 components
+list_file="$nightly_list_location/nightly_sandbox_maven2_list.txt"
+components=`<$list_file`
+current_root=$sandbox_root
+echo
+echo "=========================================="
+echo " Building Sandbox Maven 2 Components      "
+echo "=========================================="
+process_maven2_components
+
+# Make tar/zip files group writable
 ssh $deploy_host chmod -R g+w $deploy_location
+
+# Workaround m2 deploy bug - should be able to drop this soon
+ssh $deploy_host /www/people.apache.org/repo/m2-snapshot-repository/fix-permissions.sh
 
 # Send failure notification email if there are build failures
 if [ ${#failed_builds[@]} -gt 0 ]



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message