Repository: james-project Updated Branches: refs/heads/master 1ce23080e -> 32e5edd40
JAMES-1831 Add a docker container for producing website Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/9a93fd94 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/9a93fd94 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/9a93fd94 Branch: refs/heads/master Commit: 9a93fd9431d28960b3d599c4fedc265a5b4916d0 Parents: 1ce2308 Author: Benoit Tellier <btell...@linagora.com> Authored: Thu Oct 6 14:11:52 2016 +0200 Committer: Benoit Tellier <btell...@linagora.com> Committed: Thu Oct 20 15:40:00 2016 +0200 ---------------------------------------------------------------------- README.adoc | 4 +++ dockerfiles/site/Dockerfile | 22 ++++++++++++++++ dockerfiles/site/compile.sh | 55 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/9a93fd94/README.adoc ---------------------------------------------------------------------- diff --git a/README.adoc b/README.adoc index 31dda5b..a78b59a 100644 --- a/README.adoc +++ b/README.adoc @@ -50,6 +50,10 @@ To deploy the technical reports use the "-Psite-reports" profile. For wagon-ssh-external configuration see http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ssh-external.html +You can alternatively use a docker container to build the website : + + $ docker build -t james/site dockerfiles/site + $ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/site:/destination james/site master Howto release via maven release plugin ====================================== http://git-wip-us.apache.org/repos/asf/james-project/blob/9a93fd94/dockerfiles/site/Dockerfile ---------------------------------------------------------------------- diff --git a/dockerfiles/site/Dockerfile b/dockerfiles/site/Dockerfile new file mode 100644 index 0000000..1bd3e76 --- /dev/null +++ b/dockerfiles/site/Dockerfile @@ -0,0 +1,22 @@ +# Build James +# +# VERSION 1.0 + +FROM java:openjdk-6-jdk + +# 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 + +# Copy the script +COPY compile.sh /root/compile.sh + +# Define the entrypoint +WORKDIR /james-project +ENTRYPOINT ["/root/compile.sh"] http://git-wip-us.apache.org/repos/asf/james-project/blob/9a93fd94/dockerfiles/site/compile.sh ---------------------------------------------------------------------- diff --git a/dockerfiles/site/compile.sh b/dockerfiles/site/compile.sh new file mode 100755 index 0000000..3b313a1 --- /dev/null +++ b/dockerfiles/site/compile.sh @@ -0,0 +1,55 @@ +#!/bin/sh -e +# + +printUsage() { + echo "Usage : " + echo "./compile.sh SHA1" + echo " SHA1: SHA1 to build (optional)" + exit 1 +} + +ORIGIN=/origin +DESTINATION=/destination + +for arg in "$@" +do + case $arg in + -*) + 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=master +fi + +# Sources retrieval +git clone $ORIGIN/. +git checkout $SHA1 + +# Compilation + +mvn clean install -DskipTests +mvn clean site:site -Dmaven.javadoc.skip=true + +# Retrieve result + +if [ $? -eq 0 ]; then + cp -r target/site/* $DESTINATION/ + cp -r server/target/site $DESTINATION/server + cp -r mailbox/target/site $DESTINATION/mailbox + cp -r protocols/target/site $DESTINATION/protocols + cp -r mailet/target/site $DESTINATION/mailet + cp -r mpt/target/site $DESTINATION/mpt + +fi --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org