You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuweni.apache.org by to...@apache.org on 2020/05/09 04:50:41 UTC

[incubator-tuweni] 02/03: Add docker build to allow testing in isolation

This is an automated email from the ASF dual-hosted git repository.

toulmean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git

commit bbf168bf185d866b7d3c7ed008d3509c7d99e002
Author: Antoine Toulme <an...@lunar-ocean.com>
AuthorDate: Fri May 8 00:26:22 2020 -0700

    Add docker build to allow testing in isolation
---
 build.sh                         |  9 +++------
 gradle/build.Dockerfile          |  3 +++
 gradle/docker/build.sh           |  0
 gradle/docker/docker-compose.yml | 22 ++++++++++++++++++++++
 gradle/docker/test.Dockerfile    | 10 ++++++++++
 5 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/build.sh b/build.sh
index dfd55d8..fb73b54 100755
--- a/build.sh
+++ b/build.sh
@@ -10,9 +10,6 @@
 # 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.
-
-COMMAND=$1
-if [ -z "$COMMAND" ];then
-  COMMAND="build"
-fi
-docker run -it -v `pwd`:/home/gradle gradle:5.0-jdk11 gradle --no-daemon -Dorg.gradle.jvmargs="-Xmx4g -XX:MaxMetaspaceSize=512m" $COMMAND
\ No newline at end of file
+cd gradle/docker
+docker build -t tuweni_test -f test.Dockerfile ../..
+docker-compose up
\ No newline at end of file
diff --git a/gradle/build.Dockerfile b/gradle/build.Dockerfile
index e69de29..ecdac8e 100644
--- a/gradle/build.Dockerfile
+++ b/gradle/build.Dockerfile
@@ -0,0 +1,3 @@
+FROM gradle:6.3-jdk11
+
+RUN apt-get update && apt-get install -y libsodium-dev && apt-get clean
\ No newline at end of file
diff --git a/gradle/docker/build.sh b/gradle/docker/build.sh
deleted file mode 100644
index e69de29..0000000
diff --git a/gradle/docker/docker-compose.yml b/gradle/docker/docker-compose.yml
index e69de29..c7eca70 100644
--- a/gradle/docker/docker-compose.yml
+++ b/gradle/docker/docker-compose.yml
@@ -0,0 +1,22 @@
+# 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.
+version: "3.6"
+services:
+  test:
+    container_name: test
+    image: tuweni_test
+    volumes:
+      - ../../build/libs:/home/gradle/build/libs
+    command: gradle --no-daemon -Dorg.gradle.jvmargs="-Xmx4g -XX:MaxMetaspaceSize=512m" assemble test
+  integration-test:
+    container_name: integration-test
+    image: tuweni_test
+    command: gradle --no-daemon -Dorg.gradle.jvmargs="-Xmx4g -XX:MaxMetaspaceSize=512m" integrationTest
\ No newline at end of file
diff --git a/gradle/docker/test.Dockerfile b/gradle/docker/test.Dockerfile
index 89d8842..1f867c7 100644
--- a/gradle/docker/test.Dockerfile
+++ b/gradle/docker/test.Dockerfile
@@ -1,3 +1,13 @@
+# 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.
 FROM gradle:6.3-jdk11
 
 RUN apt-get update && apt-get install -y libsodium-dev && apt-get clean


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tuweni.apache.org
For additional commands, e-mail: commits-help@tuweni.apache.org