giraph-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ach...@apache.org
Subject svn commit: r1401165 - in /giraph/trunk: CHANGELOG dev-support/for-each-profile.sh
Date Tue, 23 Oct 2012 05:28:06 GMT
Author: aching
Date: Tue Oct 23 05:28:05 2012
New Revision: 1401165

URL: http://svn.apache.org/viewvc?rev=1401165&view=rev
Log:
GIRAPH-385: Script for running on all profiles. (nitay via aching)

Added:
    giraph/trunk/dev-support/for-each-profile.sh   (with props)
Modified:
    giraph/trunk/CHANGELOG

Modified: giraph/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/giraph/trunk/CHANGELOG?rev=1401165&r1=1401164&r2=1401165&view=diff
==============================================================================
--- giraph/trunk/CHANGELOG (original)
+++ giraph/trunk/CHANGELOG Tue Oct 23 05:28:05 2012
@@ -1,6 +1,9 @@
 Giraph Change Log
 
 Release 0.2.0 - unreleased
+
+  GIRAPH-385: Script for running on all profiles. (nitay via aching)
+
   GIRAPH-384: Remove duplicate BspCase in giraph-formats-contrib (and
   fix GIRAPH-382 breaking the build). (aching)
 

Added: giraph/trunk/dev-support/for-each-profile.sh
URL: http://svn.apache.org/viewvc/giraph/trunk/dev-support/for-each-profile.sh?rev=1401165&view=auto
==============================================================================
--- giraph/trunk/dev-support/for-each-profile.sh (added)
+++ giraph/trunk/dev-support/for-each-profile.sh Tue Oct 23 05:28:05 2012
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+if [[ -z `which xpath 2> /dev/null` ]]; then
+  echo "ERROR: xpath not found in path"
+  exit
+fi
+
+function parse_profiles {
+  all_profiles=""
+  poms=$(find . -name pom.xml)
+  for pom in $poms; do
+    # Returns something like:
+    #   <id>hadoop_0.20.203</id><id>hadoop_1.0</id><id>hadoop_non_secure</id>
...
+    profiles=$(xpath $pom '//project/profiles/profile/id' 2> /dev/null)
+
+    # Transform into:
+    #   hadoop_0.20.203 hadoop_1.0 ...
+    profiles=${profiles//<\/id>/}
+    profiles=${profiles//<id>/ }
+
+    # Append to accumulating list
+    all_profiles="$all_profiles $profiles"
+  done
+
+  # Sort and uniq the whole list
+  all_profiles=$(echo "$all_profiles" | tr -s ' ' "\n" | sort | uniq)
+}
+
+parse_profiles
+
+for profile in $all_profiles; do
+  echo "======================"
+  echo "=== $profile ==="
+  echo "======================"
+
+  mvn -P$profile $@
+  result=$?
+
+  if [[ $result -ne 0 ]]; then
+    echo "======================"
+    echo "=== Failed on profile: $profile"
+    echo "=== Failed command: mvn -P$profile $@"
+    echo "======================"
+    exit $result
+  fi
+done

Propchange: giraph/trunk/dev-support/for-each-profile.sh
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message