Browse Source

Properly add JDK deps in the Docker image.

Josh Haberman 9 năm trước cách đây
mục cha
commit
0f8c25d105
3 tập tin đã thay đổi với 19 bổ sung5 xóa
  1. 10 2
      tools/docker/Dockerfile
  2. 1 1
      tools/run_tests/jenkins.sh
  3. 8 2
      tools/run_tests/tests.sh

+ 10 - 2
tools/docker/Dockerfile

@@ -30,7 +30,8 @@
 # Base Dockerfile for gRPC dev images
 FROM debian:latest
 
-# Install Git.
+# Install dependencies.  We start with the basic ones require to build protoc
+# and the C++ build
 RUN apt-get update && apt-get install -y \
   autoconf \
   autotools-dev \
@@ -52,7 +53,14 @@ RUN apt-get update && apt-get install -y \
   telnet \
   unzip \
   wget \
-  zip && apt-get clean
+  zip \
+  # For all Java builds \
+  maven \
+  # For java_jdk6 \
+  # oops! not in Jessie. Too old? openjdk-6-jdk \
+  # For java_jdk7 \
+  openjdk-7-jdk \
+  && apt-get clean
 
 # Prepare ccache
 RUN ln -s /usr/bin/ccache /usr/local/bin/gcc

+ 1 - 1
tools/run_tests/jenkins.sh

@@ -19,5 +19,5 @@ cd protobuf
 $TEST_SCRIPT cpp || exit 1
 
 # Other tests can fail and we keep on going.
-$TEST_SCRIPT java_jdk6
+#$TEST_SCRIPT java_jdk6
 $TEST_SCRIPT java_jdk7

+ 8 - 2
tools/run_tests/tests.sh

@@ -1,5 +1,11 @@
 #!/bin/bash
 
+on_travis() {
+  if [ "$TRAVIS" == "true" ]; then
+    "$@"
+  fi
+}
+
 # For when some other test needs the C++ main build, including protoc and
 # libprotobuf.
 internal_build_cpp() {
@@ -75,11 +81,11 @@ use_java() {
   version=$1
   case "$version" in
     jdk6)
-      sudo apt-get install openjdk-6-jdk
+      on_travis sudo apt-get install openjdk-6-jdk
       export PATH=/usr/lib/jvm/java-6-openjdk-amd64/bin:$PATH
       ;;
     jdk7)
-      sudo apt-get install openjdk-7-jdk
+      on_travis sudo apt-get install openjdk-7-jdk
       export PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH
       ;;
     oracle7)