tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject [tomee] branch master updated: Enhanced docker-compose.yml for non-root user build and debug
Date Wed, 20 Feb 2019 21:29:23 GMT
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git


The following commit(s) were added to refs/heads/master by this push:
     new dc3edcf  Enhanced docker-compose.yml for non-root user build and debug
     new 102dc4b  Merge pull request #401 from j4fm/Enhance-Docker-Compose
dc3edcf is described below

commit dc3edcf444373ff0bb41bad49a36f881311b0f4f
Author: James Meen <james.meen@my-managed.net>
AuthorDate: Mon Feb 18 18:24:28 2019 +0000

    Enhanced docker-compose.yml for non-root user build and debug
---
 docker-compose.yml | 63 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 57 insertions(+), 6 deletions(-)

diff --git a/docker-compose.yml b/docker-compose.yml
index f1818c4..6399f3b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -19,22 +19,73 @@ version: '2'
 volumes:
         m2:
 services:
-    mvn:
+    # This service is a workaround to set volume permissions so that they are correct for
non-root user build
+    volume_perms:
+        image: alpine
+        command: "chown -R 1000:1000 /var/maven"
+        volumes:
+            - m2:/var/maven/.m2
+    # Build+test. Stops on first test failure
+    build:
         image: "maven:3.3.9-jdk-8"
+        command: ["-Duser.home=/var/maven", "-Pall-adapters", "-Dsurefire.useFile=false",
"-DdisableXmlReport=true", "clean", "install"]
         entrypoint: "mvn"
         working_dir: /opt/project
+        user: 1000:1000
         environment:
             - MAVEN_OPTS=-Xmx768m -XX:ReservedCodeCacheSize=64m -Xss2048k
+            - MAVEN_CONFIG=/var/maven/.m2
         volumes:
-            - m2:/root/.m2
+            - m2:/var/maven/.m2
             - .:/opt/project
-    quickbuild:
+        depends_on:
+            - volume_perms
+    # Build+test. Does not stop on test failures
+    build-all:
         image: "maven:3.3.9-jdk-8"
-        command: ["mvn", "-Pquick", "-Dsurefire.useFile=false", "-DdisableXmlReport=true",
"-DuniqueVersion=false", "-ff", "-Dassemble", "-DskipTests", "-DfailIfNoTests=false", "clean",
"install"]
+        command: ["--fail-at-end", "-Duser.home=/var/maven", "-Pall-adapters", "-Dsurefire.useFile=false",
"-DdisableXmlReport=true", "clean", "install"]
+        entrypoint: "mvn"
         working_dir: /opt/project
+        user: 1000:1000
+        ports:
+            - 5005:5005
         environment:
             - MAVEN_OPTS=-Xmx768m -XX:ReservedCodeCacheSize=64m -Xss2048k
+            - MAVEN_CONFIG=/var/maven/.m2
         volumes:
-            - m2:/root/.m2
+            - m2:/var/maven/.m2
             - .:/opt/project
-
+        depends_on:
+            - volume_perms
+        # Just build (no tests)
+    build-quick:
+        image: "maven:3.3.9-jdk-8"
+        command: ["-Duser.home=/var/maven", "-Pquick", "-Dsurefire.useFile=false", "-DdisableXmlReport=true",
"-DuniqueVersion=false", "-ff", "-Dassemble", "-DskipTests", "-DfailIfNoTests=false", "clean",
"install"]
+        entrypoint: "mvn"
+        working_dir: /opt/project
+        user: 1000:1000
+        environment:
+            - MAVEN_OPTS=-Xmx768m -XX:ReservedCodeCacheSize=64m -Xss2048k
+            - MAVEN_CONFIG=/var/maven/.m2
+        volumes:
+            - m2:/var/maven/.m2
+            - .:/opt/project
+        depends_on:
+            - volume_perms
+    # Build+test. Waits for debugger on port 5005. Stops on first test failure
+    debug:
+        image: "maven:3.3.9-jdk-8"
+        command: ["-Duser.home=/var/maven", "-Pall-adapters", "-Dsurefire.useFile=false",
"-DdisableXmlReport=true", "-Dopenejb.server.debug", "-Dmaven.surefire.debug", "-Dopenejb.arquillian.debug=true",
"clean", "install"]
+        entrypoint: "mvn"
+        working_dir: /opt/project
+        user: 1000:1000
+        ports:
+            - 5005:5005
+        environment:
+            - MAVEN_OPTS=-Xmx768m -XX:ReservedCodeCacheSize=64m -Xss2048k
+            - MAVEN_CONFIG=/var/maven/.m2
+        volumes:
+            - m2:/var/maven/.m2
+            - .:/opt/project
+        depends_on:
+            - volume_perms
\ No newline at end of file


Mime
View raw message