Author: matthieu
Date: Mon Oct 26 15:11:18 2015
New Revision: 1710619

URL: http://svn.apache.org/viewvc?rev=1710619&view=rev
Log:
JAMES-1628 Provide environment for JAVA 8 compilation (cassandra profile)

           Contributed by Antoine Duprat and Raphael Ouazana

Added:
    james/project/trunk/dockerfiles/
    james/project/trunk/dockerfiles/compilation/
    james/project/trunk/dockerfiles/compilation/java-8/
    james/project/trunk/dockerfiles/compilation/java-8/Dockerfile
    james/project/trunk/dockerfiles/compilation/java-8/compile.sh   (with props)
    james/project/trunk/dockerfiles/destination/
    james/project/trunk/dockerfiles/destination/.gitignore
Modified:
    james/project/trunk/README.txt

Modified: james/project/trunk/README.txt
URL: 
http://svn.apache.org/viewvc/james/project/trunk/README.txt?rev=1710619&r1=1710618&r2=1710619&view=diff
==============================================================================
--- james/project/trunk/README.txt (original)
+++ james/project/trunk/README.txt Mon Oct 26 15:11:18 2015
@@ -41,4 +41,26 @@ In short, just follow the 'standard' pro
 Don't forget to add your key to http://www.apache.org/dist/james/KEYS
 
     $ ssh people.apache.org
-    $ cd /www/www.apache.org/dist/james
\ No newline at end of file
+    $ cd /www/www.apache.org/dist/james
+
+
+Howto check the compilation
+===========================
+
+In order to have a standard compilation environment, we introduce Dockerfiles.
+
+* Java 8
+First step, you have to build the Docker image
+$ docker build -t james/project dockerfiles/compilation/java-8
+
+In order to run the build, you have to launch the following command:
+$ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v 
$PWD/dockerfiles/destination:/destination -t james/project -s SHA1
+
+Where:
+
+- $PWD/.m2:/root/.m2: is the first volume used to share the maven repository, 
+as we don't want to download all dependencies on each build
+- $PWD/dockerfiles/destination:/destination: is the third volume used to get 
the compiled elements, 
+as it is needed by the container that will run James.
+- SHA1 (optional): is the given git SHA1 of the james-project repository to 
build or trunk if none.
+- -s option: given tests will not be played while building. Not specifying 
means play tests.

Added: james/project/trunk/dockerfiles/compilation/java-8/Dockerfile
URL: 
http://svn.apache.org/viewvc/james/project/trunk/dockerfiles/compilation/java-8/Dockerfile?rev=1710619&view=auto
==============================================================================
--- james/project/trunk/dockerfiles/compilation/java-8/Dockerfile (added)
+++ james/project/trunk/dockerfiles/compilation/java-8/Dockerfile Mon Oct 26 
15:11:18 2015
@@ -0,0 +1,24 @@
+# Build James
+#
+# VERSION      1.0
+
+FROM java:openjdk-8-jdk
+
+ENV GIT_VERSION 1:2.1.4-2.1
+
+# Install Maven
+WORKDIR /root
+RUN wget 
http://mirrors.ircam.fr/pub/apache/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz
+RUN tar -xvf apache-maven-3.3.1-bin.tar.gz
+RUN ln -s /root/apache-maven-3.3.1/bin/mvn /usr/bin/mvn
+
+# Install git
+RUN apt-get update
+RUN apt-get install -y git="$GIT_VERSION"
+
+# Copy the script
+COPY compile.sh /root/compile.sh
+
+# Define the entrypoint
+WORKDIR /james-project
+ENTRYPOINT ["/root/compile.sh"]

Added: james/project/trunk/dockerfiles/compilation/java-8/compile.sh
URL: 
http://svn.apache.org/viewvc/james/project/trunk/dockerfiles/compilation/java-8/compile.sh?rev=1710619&view=auto
==============================================================================
--- james/project/trunk/dockerfiles/compilation/java-8/compile.sh (added)
+++ james/project/trunk/dockerfiles/compilation/java-8/compile.sh Mon Oct 26 
15:11:18 2015
@@ -0,0 +1,56 @@
+#!/bin/sh -e
+#
+
+printUsage() {
+   echo "Usage : "
+   echo "./compile.sh [-s | --skipTests] SHA1"
+   echo "    -s: Skip test"
+   echo "    SHA1: SHA1 to build (optional)"
+   exit 1
+}
+
+ORIGIN=/origin
+DESTINATION=/destination
+
+for arg in "$@"
+do
+   case $arg in
+      -s|--skipTests)
+         SKIPTESTS="skipTests"
+         ;;
+      -*)
+         echo "Invalid option: -$OPTARG"
+         printUsage
+         ;;
+      *)
+         if ! [ -z "$1" ]; then
+            SHA1=$1
+         fi
+         ;;
+   esac
+   if [ "0" -lt "$#" ]; then
+      shift
+   fi
+done
+
+if [ -z "$SHA1" ]; then
+   SHA1=trunk
+fi
+
+# Sources retrieval
+git clone $ORIGIN/.
+git checkout $SHA1
+
+# Compilation
+
+if [ "$SKIPTESTS" = "skipTests" ]; then
+   mvn package -DskipTests -Pcassandra,exclude-lucene,with-assembly,with-jetm
+else
+   mvn package -Pcassandra,exclude-lucene,with-assembly,with-jetm
+fi
+
+# Retrieve result
+
+if [ $? -eq 0 ]; then
+   cp server/app/target/james-server-app-*-app.zip $DESTINATION
+fi

Propchange: james/project/trunk/dockerfiles/compilation/java-8/compile.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: james/project/trunk/dockerfiles/destination/.gitignore
URL: 
http://svn.apache.org/viewvc/james/project/trunk/dockerfiles/destination/.gitignore?rev=1710619&view=auto
==============================================================================
--- james/project/trunk/dockerfiles/destination/.gitignore (added)
+++ james/project/trunk/dockerfiles/destination/.gitignore Mon Oct 26 15:11:18 
2015
@@ -0,0 +1,2 @@
+*.zip
+keystore
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to