Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1666 bee501cb2 -> dd7f365a5


Set up correct volume structure


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/dd7f365a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/dd7f365a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/dd7f365a

Branch: refs/heads/feature/GEODE-1666
Commit: dd7f365a52e91bb8b8af6539bb6198701469291c
Parents: bee501c
Author: Jens Deppe <jde...@pivotal.io>
Authored: Thu Jul 21 09:07:50 2016 -0700
Committer: Jens Deppe <jde...@pivotal.io>
Committed: Thu Jul 21 09:07:50 2016 -0700

----------------------------------------------------------------------
 gradle/test.gradle | 36 +++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dd7f365a/gradle/test.gradle
----------------------------------------------------------------------
diff --git a/gradle/test.gradle b/gradle/test.gradle
index 2fdff87..011c2c6 100644
--- a/gradle/test.gradle
+++ b/gradle/test.gradle
@@ -137,15 +137,32 @@ subprojects {
 
     docker {
       // base image for creating docker containers that execute the tests
-      image = 'gemfire/centos7-gradle'
+      image = 'gemfire/ubuntu-jdk8-docker'
 
       // volumes mounted to the containers
       // in a form: host_dir : container_dir
-      def gradleHome = System.getenv("GRADLE_USER_HOME")
-      def pwd = System.getenv("PWD")
-      def java_home = System.getenv("JAVA_HOME")
+      def pwd = System.getenv('PWD')
+      def gradleHome = System.getenv('GRADLE_USER_HOME') ?: 
"${System.getenv('HOME')}/.gradle"
       volumes = ["${gradleHome}":gradleHome]
-      volumes << ["${pwd}":pwd]
+
+      // Figure out if we're building Geode or GemFire
+      if (new File(pwd, 'geode-core').exists()) {
+        volumes << ["${pwd}":pwd]
+      } else {
+        // Assume that our directory structure has 'open/' in the parent of 
the PWD.
+        // For example:
+        //   .../gemfire (PWD)
+        //      +--/gemfire-test
+        //      +--/etc
+        //   .../open
+        //      +--/geode-core
+        //      +--/etc
+        def gemfireDir = new File("${pwd}").getParent()
+        // Make sure we resolve symlinks by using getCanonicalPath
+        def geodeDir = new File(gemfireDir, 'open').getCanonicalPath()
+        volumes << ["${gemfireDir}": gemfireDir]
+        volumes << ["${geodeDir}": geodeDir]
+      }
 
       // specify the user for starting Gradle test worker
       // within the container, default to current user
@@ -166,10 +183,11 @@ subprojects {
           j++
         }
 
-        //        if (javaHomeIdx > 0) {
-        //          args.removeAt(javaHomeIdx-1)
-        //          args.removeAt(javaHomeIdx-1)
-        //        }
+        // Remove JAVA_HOME env variable - it might not be the same as the 
container needs
+        if (javaHomeIdx > 0) {
+          args.removeAt(javaHomeIdx-1)
+          args.removeAt(javaHomeIdx-1)
+        }
 
         // custom args processing and tweaking
         // of the docker command starting the testworker inside a container

Reply via email to