Repository: calcite-avatica
Updated Branches:
  refs/heads/master 5b96a8d20 -> a2afc82ec


Add docker hub image for HSQLDB


Project: http://git-wip-us.apache.org/repos/asf/calcite-avatica/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite-avatica/commit/a2afc82e
Tree: http://git-wip-us.apache.org/repos/asf/calcite-avatica/tree/a2afc82e
Diff: http://git-wip-us.apache.org/repos/asf/calcite-avatica/diff/a2afc82e

Branch: refs/heads/master
Commit: a2afc82ecfee4cabb6d851be7f28e1b0ec63f8dd
Parents: 5b96a8d
Author: Francis Chuang <francis.chu...@boostport.com>
Authored: Fri Apr 13 09:22:47 2018 +1000
Committer: Francis Chuang <francischu...@apache.org>
Committed: Fri May 4 08:31:25 2018 +1000

----------------------------------------------------------------------
 docker/src/main/dockerhub-hypersql/Dockerfile   | 27 ++++++++++++
 .../verify-dockerhub-dockerfile-version.groovy  | 43 +++++++++++---------
 2 files changed, 50 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/a2afc82e/docker/src/main/dockerhub-hypersql/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/src/main/dockerhub-hypersql/Dockerfile 
b/docker/src/main/dockerhub-hypersql/Dockerfile
new file mode 100644
index 0000000..e09d519
--- /dev/null
+++ b/docker/src/main/dockerhub-hypersql/Dockerfile
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ARG AVATICA_VERSION=1.11.0
+FROM apache/calcite-avatica:$AVATICA_VERSION
+MAINTAINER Apache Avatica <d...@calcite.apache.org>
+
+ARG HSQLDB_VERSION="2.4.0"
+
+# Dependencies
+ADD 
https://repo1.maven.org/maven2/net/hydromatic/scott-data-hsqldb/0.1/scott-data-hsqldb-0.1.jar
 /home/avatica/classpath/
+ADD 
https://repo1.maven.org/maven2/org/hsqldb/hsqldb/${HSQLDB_VERSION}/hsqldb-${HSQLDB_VERSION}.jar
 /home/avatica/classpath/
+
+# Add on to avatica-server's entrypoint
+CMD ["-u", "jdbc:hsqldb:res:scott"]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/a2afc82e/docker/src/test/scripts/verify-dockerhub-dockerfile-version.groovy
----------------------------------------------------------------------
diff --git a/docker/src/test/scripts/verify-dockerhub-dockerfile-version.groovy 
b/docker/src/test/scripts/verify-dockerhub-dockerfile-version.groovy
index 66c7bec..da7d4f3 100644
--- a/docker/src/test/scripts/verify-dockerhub-dockerfile-version.groovy
+++ b/docker/src/test/scripts/verify-dockerhub-dockerfile-version.groovy
@@ -28,26 +28,29 @@ if (null == expectedVersion) {
   throw new IllegalArgumentException("Did not find Maven project version");
 }
 
-String dockerfilePath = "src/main/dockerhub/Dockerfile";
-File dockerfile = new File(basedir, dockerfilePath);
-if (!dockerfile.isFile()) {
-  throw new FileNotFoundException("Could not file dockerhub Dockerfile at " + 
dockerfilePath);
-}
+def dockerfiles = ["src/main/dockerhub/Dockerfile", 
"src/main/dockerhub-hypersql/Dockerfile"]
 
-List<String> lines = Files.readAllLines(dockerfile.toPath());
-for (String line : lines) {
-  line = line.trim();
-  if (line.startsWith(expectedPrefix)) {
-    String value = line.substring(expectedPrefix.length());
-    // Trim leading and trailing quotation marks
-    value = value.substring(1, value.length() - 1);
-    if (expectedVersion.equals(value)) {
-      System.out.println("Found expected version in DockerHub dockerfile of " 
+ value);
-      return true;
-    } else {
-      throw new IllegalArgumentException("Expected Avatica version of " + 
expectedVersion + " but got " + value);
+for (dockerfilePath in dockerfiles) {
+    File dockerfile = new File(basedir, dockerfilePath);
+    if (!dockerfile.isFile()) {
+      throw new FileNotFoundException("Could not file dockerhub Dockerfile at 
" + dockerfilePath);
     }
-  }
-}
 
-throw new IllegalArgumentException("Could not extract Avatica version from " + 
dockerfile);
+    List<String> lines = Files.readAllLines(dockerfile.toPath());
+    for (String line : lines) {
+      line = line.trim();
+      if (line.startsWith(expectedPrefix)) {
+        String value = line.substring(expectedPrefix.length());
+        // Trim leading and trailing quotation marks
+        value = value.substring(1, value.length() - 1);
+        if (expectedVersion.equals(value)) {
+          System.out.println("Found expected version in DockerHub dockerfile 
of " + value);
+          return true;
+        } else {
+          throw new IllegalArgumentException("Expected Avatica version of " + 
expectedVersion + " but got " + value);
+        }
+      }
+    }
+
+    throw new IllegalArgumentException("Could not extract Avatica version from 
" + dockerfile);
+}

Reply via email to