Author: matthieu Date: Mon Oct 26 15:15:02 2015 New Revision: 1710622 URL: http://svn.apache.org/viewvc?rev=1710622&view=rev Log: JAMES-1628 Provide environment for JAVA 6 compilation
Contributed by Antoine Duprat and Raphael Ouazana Added: james/project/trunk/dockerfiles/compilation/java-6/ james/project/trunk/dockerfiles/compilation/java-6/Dockerfile james/project/trunk/dockerfiles/compilation/java-6/compile.sh (with props) Modified: james/project/trunk/README.txt Modified: james/project/trunk/README.txt URL: http://svn.apache.org/viewvc/james/project/trunk/README.txt?rev=1710622&r1=1710621&r2=1710622&view=diff ============================================================================== --- james/project/trunk/README.txt (original) +++ james/project/trunk/README.txt Mon Oct 26 15:15:02 2015 @@ -48,6 +48,26 @@ Howto check the compilation =========================== In order to have a standard compilation environment, we introduce Dockerfiles. +We need to check the compilation in both Java 6 & Java 8: +- Java 6 is the historical Java release used in James. +- Java 8 is used to compile the Cassandra backend. + +* Java 6 +First step, you have to build the Docker image +$ docker build -t james/project dockerfiles/compilation/java-6 + +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. + * Java 8 First step, you have to build the Docker image Added: james/project/trunk/dockerfiles/compilation/java-6/Dockerfile URL: http://svn.apache.org/viewvc/james/project/trunk/dockerfiles/compilation/java-6/Dockerfile?rev=1710622&view=auto ============================================================================== --- james/project/trunk/dockerfiles/compilation/java-6/Dockerfile (added) +++ james/project/trunk/dockerfiles/compilation/java-6/Dockerfile Mon Oct 26 15:15:02 2015 @@ -0,0 +1,24 @@ +# Build James +# +# VERSION 1.0 + +FROM java:openjdk-6-jdk + +ENV GIT_VERSION 1:1.7.10.4-1+wheezy1 + +# Install Maven +WORKDIR /root +RUN wget http://mirrors.ircam.fr/pub/apache/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz +RUN tar -xvf apache-maven-3.2.5-bin.tar.gz +RUN ln -s /root/apache-maven-3.2.5/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-parent +ENTRYPOINT ["/root/compile.sh"] Added: james/project/trunk/dockerfiles/compilation/java-6/compile.sh URL: http://svn.apache.org/viewvc/james/project/trunk/dockerfiles/compilation/java-6/compile.sh?rev=1710622&view=auto ============================================================================== --- james/project/trunk/dockerfiles/compilation/java-6/compile.sh (added) +++ james/project/trunk/dockerfiles/compilation/java-6/compile.sh Mon Oct 26 15:15:02 2015 @@ -0,0 +1,50 @@ +#!/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 +else + mvn package +fi Propchange: james/project/trunk/dockerfiles/compilation/java-6/compile.sh ------------------------------------------------------------------------------ svn:executable = * --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org