Repository: brooklyn-library
Updated Branches:
  refs/heads/master 0c0f1a81d -> 01cc0b584


jenkins: don't bind mount .m2


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/893ca1b0
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/893ca1b0
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/893ca1b0

Branch: refs/heads/master
Commit: 893ca1b0f0e9b55961116a5c53cee4af18a46897
Parents: 0c0f1a8
Author: Aled Sage <aled.s...@gmail.com>
Authored: Mon Sep 24 16:11:43 2018 +0100
Committer: Aled Sage <aled.s...@gmail.com>
Committed: Tue Sep 25 09:38:08 2018 +0100

----------------------------------------------------------------------
 Dockerfile              |  4 ++++
 Jenkinsfile             |  8 ++++----
 README.md               | 34 ++++++++++++++++++++++------------
 software/webapp/pom.xml |  1 +
 4 files changed, 31 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/893ca1b0/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
index 662762f..75fca62 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,3 +19,7 @@ FROM maven:3.5.4-jdk-8-alpine
 
 # Install necessary binaries to build brooklyn-library
 RUN apk add --no-cache git procps
+
+RUN mkdir -p /var/maven/.m2/ && chmod -R 777 /var/maven/
+ENV MAVEN_CONFIG=/var/maven/.m2
+

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/893ca1b0/Jenkinsfile
----------------------------------------------------------------------
diff --git a/Jenkinsfile b/Jenkinsfile
index 76a41e3..67c1b79 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -36,16 +36,16 @@ node(label: 'ubuntu') {
             }
 
             stage('Run tests') {
-                environmentDockerImage.inside('-i --name 
brooklyn-${DOCKER_TAG} -u 910:910 -v ${WORKSPACE}/.m2:/var/maven/.m2 -v 
${WORKSPACE}:/usr/build -w /usr/build -e MAVEN_CONFIG=/var/maven/.m2') {
-                    sh 'mvn clean install -Duser.name=$(id -un 910)'
+                environmentDockerImage.inside('-i --name 
brooklyn-${DOCKER_TAG} -u 910:910 --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
+                    sh 'mvn clean install -Duser.home=/var/maven 
-Duser.name=$(id -un 910)'
                 }
             }
 
             // Conditional stage to deploy artifacts, when not building a PR
             if (env.CHANGE_ID == null) {
                 stage('Deploy artifacts') {
-                    environmentDockerImage.inside('-i --name 
brooklyn-${DOCKER_TAG} -u 910:910 -v ${WORKSPACE}/.m2:/var/maven/.m2 -v 
${WORKSPACE}:/usr/build -w /usr/build -e MAVEN_CONFIG=/var/maven/.m2') {
-                        sh 'mvn deploy -DskipTests -Duser.name=$(id -un 910)'
+                    environmentDockerImage.inside('-i --name 
brooklyn-${DOCKER_TAG} -u 910:910 -v ${WORKSPACE}:/usr/build -w /usr/build') {
+                        sh 'mvn deploy -DskipTests -Duser.home=/var/maven 
-Duser.name=$(id -un 910)'
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/893ca1b0/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 147295e..7cc40b2 100644
--- a/README.md
+++ b/README.md
@@ -4,12 +4,20 @@
 ### Library of Entities for Apache Brooklyn
 
 This sub-project contains various entities not *needed* for Brooklyn,
-but useful in practice as building blocks, including entities for webapps,
+but useful as building blocks, including entities for webapps,
 datastores, and more.
 
 ### Building the project
 
-2 methods are available to build this project: within a docker container or 
directly with maven.
+Two methods are available to build this project: within a docker container or 
directly with maven.
+
+#### Using maven
+
+Simply run:
+
+```bash
+mvn clean install
+```
 
 #### Using docker
 
@@ -23,16 +31,18 @@ docker build -t brooklyn:library .
 Then run the build:
 
 ```bash
-docker run -i --rm --name brooklyn-library -u $(id -u $(whoami)):$(id -g 
$(whoami)) \
-    -e MAVEN_CONFIG=/var/maven/.m2 \
-    -v ${HOME}/.m2:/var/maven/.m2 -v ${PWD}:/usr/build -w /usr/build \
-    brooklyn:library mvn clean install -Duser.home=/var/maven 
-Duser.name=$(whoami)
-```
+docker run -i --rm --name brooklyn-library -u $(id -u):$(id -g) \
+     --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 \
+     -v ${PWD}:/usr/build -w /usr/build \
+     brooklyn:library mvn clean install -Duser.home=/var/maven 
-Duser.name=$(id -un)
 
-### Using maven
-
-Simply run:
+```
 
-```bash
-mvn clean install
+You can speed this up by using your local .m2 cache:
+```
+docker run -i --rm --name brooklyn-library -u $(id -u):$(id -g) \
+    -v ${HOME}/.m2:/var/maven/.m2 \
+    -v ${PWD}:/usr/build -w /usr/build \
+    brooklyn:library mvn clean install -Duser.home=/var/maven -Duser.name=$(id 
-un)
 ```
+

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/893ca1b0/software/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/software/webapp/pom.xml b/software/webapp/pom.xml
index 9a77f99..b58b012 100644
--- a/software/webapp/pom.xml
+++ b/software/webapp/pom.xml
@@ -48,6 +48,7 @@
                             -->
                             
<exclude>src/main/resources/org/apache/brooklyn/entity/webapp/jboss/jboss7-standalone.xml</exclude>
                             
<exclude>src/main/resources/org/apache/brooklyn/entity/webapp/jetty/jetty-brooklyn.xml</exclude>
+                            
<exclude>**/.brooklyn/brooklyn-persisted-state/**</exclude>
                         </excludes>
                     </configuration>
                 </plugin>

Reply via email to