Repository: james-project Updated Branches: refs/heads/master 6f6513dff -> 6aa2607e8
JAMES-2324 Include LDAP build in packaging Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/7aa3aec9 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/7aa3aec9 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/7aa3aec9 Branch: refs/heads/master Commit: 7aa3aec90f5e931e15d45e8cd06b8cdf17b9e03e Parents: 6f6513d Author: Raphael Ouazana <[email protected]> Authored: Wed Jan 31 17:38:08 2018 +0100 Committer: Raphael Ouazana <[email protected]> Committed: Wed Jan 31 17:47:19 2018 +0100 ---------------------------------------------------------------------- README.adoc | 14 ++++++++++++-- dockerfiles/packaging/guice/cassandra/Dockerfile | 12 +++++++++--- dockerfiles/packaging/guice/cassandra/package.sh | 10 +++++++++- .../packaging/guice/cassandra/scripts/james.postinst | 4 ++++ .../guice/cassandra/scripts/james.postremove | 4 ++++ .../guice/cassandra/scripts/james.rpm.postinst | 3 +++ .../guice/cassandra/scripts/james.rpm.postremove | 2 ++ .../packaging/guice/cassandra/scripts/package.sh | 3 ++- 8 files changed, 45 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/7aa3aec9/README.adoc ---------------------------------------------------------------------- diff --git a/README.adoc b/README.adoc index 6426eab..0d0b4e4 100644 --- a/README.adoc +++ b/README.adoc @@ -425,13 +425,17 @@ First step, you have to build the Docker image used to generate the package $ docker build -t build-james-packages \ --build-arg RELEASE=3.0-beta6 \ --build-arg ITERATION=1 \ - --build-arg BASE=linagora/james-project + --build-arg BASE=linagora/james-project \ + --build-arg BASE_LDAP=linagora/james-ldap-project \ + --build-arg TAG=latest \ dockerfiles/packaging/guice/cassandra Where: - ITERATION is the release number used after the last hyphen (e.g. 3.0-beta6-1, 3.0-beta6-2, 3.0-beta6-3...) -- BASE is the image jar and executable are copied from. Defaults to linagora/james-project:latest +- BASE is the image jar and executable are copied from. Defaults to linagora/james-project +- BASE_LDAP is the image jar and executable are copied from for a deployment with an LDAP user repository. Defaults to linagora/james-ldap-project +- TAG is the tag of these docker images. Defaults to latest. Then, you have to run the container: @@ -445,4 +449,10 @@ Note: A helper script is provided for the generation of packages for a specific $ sh dockerfiles/packaging/guice/cassandra/package.sh 3.0.1 1 c298195e84 $PWD/result +The generated package allow you to choose between a deployment with or without LDAP using update-alternatives. +Once installed, try: + + $ update-alternatives --config james + +By default James is configured without LDAP support. http://git-wip-us.apache.org/repos/asf/james-project/blob/7aa3aec9/dockerfiles/packaging/guice/cassandra/Dockerfile ---------------------------------------------------------------------- diff --git a/dockerfiles/packaging/guice/cassandra/Dockerfile b/dockerfiles/packaging/guice/cassandra/Dockerfile index 632a40d..2718d43 100644 --- a/dockerfiles/packaging/guice/cassandra/Dockerfile +++ b/dockerfiles/packaging/guice/cassandra/Dockerfile @@ -1,5 +1,8 @@ -ARG BASE=linagora/james-project:latest -FROM ${BASE} as source +ARG BASE=linagora/james-project +ARG BASE_LDAP=linagora/james-ldap-project +ARG TAG=latest +FROM ${BASE}:${TAG} as source +FROM ${BASE_LDAP}:${TAG} as sourceLdap FROM debian:8.1 @@ -11,8 +14,11 @@ RUN apt-get install -y rpm ADD scripts/ /packages COPY scripts/james.service /packages/package/usr/share/james/ -COPY --from=source /root/*.jar /packages/package/usr/share/james/ +COPY --from=source /root/james-server.jar /packages/package/usr/share/james/james-withoutldap-server.jar +COPY --from=source /root/james-cli.jar /packages/package/usr/share/james/james-cli.jar +COPY --from=sourceLdap /root/james-server.jar /packages/package/usr/share/james/james-ldap-server.jar COPY --from=source /root/james-server-cassandra-guice.lib/ /packages/package/usr/share/james/james-server-cassandra-guice.lib/ +COPY --from=sourceLdap /root/james-server-cassandra-ldap-guice.lib/ /packages/package/usr/share/james/james-server-cassandra-ldap-guice.lib/ COPY --from=source /root/james-server-cli.lib/ /packages/package/usr/share/james/james-server-cli.lib/ ARG RELEASE http://git-wip-us.apache.org/repos/asf/james-project/blob/7aa3aec9/dockerfiles/packaging/guice/cassandra/package.sh ---------------------------------------------------------------------- diff --git a/dockerfiles/packaging/guice/cassandra/package.sh b/dockerfiles/packaging/guice/cassandra/package.sh index 2d4805d..2e58d01 100644 --- a/dockerfiles/packaging/guice/cassandra/package.sh +++ b/dockerfiles/packaging/guice/cassandra/package.sh @@ -28,14 +28,22 @@ docker run \ --volume $PWD:/origin \ --volume $PWD/dockerfiles/run/guice/cassandra/destination:/cassandra/destination \ -t james/project -s $SHA1 +docker run \ + --rm \ + --volume $PWD/.m2:/root/.m2 \ + --volume $PWD:/origin \ + --volume $PWD/dockerfiles/run/guice/cassandra-ldap/destination:/cassandra/destination \ + -t james/project -s $SHA1 # Build image docker build -t james_run dockerfiles/run/guice/cassandra +docker build -t james_run_ldap dockerfiles/run/guice/cassandra-ldap # Build packages docker build -t build-james-packages \ --build-arg RELEASE=$RELEASE-$SHA1 \ --build-arg ITERATION=$ITERATION \ --build-arg BASE=james_run \ + --build-arg BASE_LDAP=james_run_ldap \ dockerfiles/packaging/guice/cassandra -docker run --rm --name james-packages -v $DIRECTORY:/result build-james-packages \ No newline at end of file +docker run --rm --name james-packages -v $DIRECTORY:/result build-james-packages http://git-wip-us.apache.org/repos/asf/james-project/blob/7aa3aec9/dockerfiles/packaging/guice/cassandra/scripts/james.postinst ---------------------------------------------------------------------- diff --git a/dockerfiles/packaging/guice/cassandra/scripts/james.postinst b/dockerfiles/packaging/guice/cassandra/scripts/james.postinst index 82306a7..a9cbe80 100644 --- a/dockerfiles/packaging/guice/cassandra/scripts/james.postinst +++ b/dockerfiles/packaging/guice/cassandra/scripts/james.postinst @@ -2,5 +2,9 @@ ln -s /etc/james /var/lib/james/conf +update-alternatives --install /usr/share/james/james-server.jar james /usr/share/james/james-ldap-server.jar 10 +update-alternatives --install /usr/share/james/james-server.jar james /usr/share/james/james-withoutldap-server.jar 20 + + systemctl enable james http://git-wip-us.apache.org/repos/asf/james-project/blob/7aa3aec9/dockerfiles/packaging/guice/cassandra/scripts/james.postremove ---------------------------------------------------------------------- diff --git a/dockerfiles/packaging/guice/cassandra/scripts/james.postremove b/dockerfiles/packaging/guice/cassandra/scripts/james.postremove new file mode 100644 index 0000000..29fc7fc --- /dev/null +++ b/dockerfiles/packaging/guice/cassandra/scripts/james.postremove @@ -0,0 +1,4 @@ +#! /bin/sh -e + +update-alternatives --remove james /usr/share/james/james-ldap-server.jar +update-alternatives --remove james /usr/share/james/james-withoutldap-server.jar http://git-wip-us.apache.org/repos/asf/james-project/blob/7aa3aec9/dockerfiles/packaging/guice/cassandra/scripts/james.rpm.postinst ---------------------------------------------------------------------- diff --git a/dockerfiles/packaging/guice/cassandra/scripts/james.rpm.postinst b/dockerfiles/packaging/guice/cassandra/scripts/james.rpm.postinst index 447b4c1..3fde16c 100644 --- a/dockerfiles/packaging/guice/cassandra/scripts/james.rpm.postinst +++ b/dockerfiles/packaging/guice/cassandra/scripts/james.rpm.postinst @@ -2,6 +2,9 @@ ln -s /etc/james /var/lib/james/conf +update-alternatives --install /usr/share/james/james-server.jar james /usr/share/james/james-ldap-server.jar 10 +update-alternatives --install /usr/share/james/james-server.jar james /usr/share/james/james-withoutldap-server.jar 20 + #Workaround waiting for https://github.com/jordansissel/fpm/issues/1163 to be released cp /usr/share/james/james.service /etc/systemd/system/ systemctl enable james http://git-wip-us.apache.org/repos/asf/james-project/blob/7aa3aec9/dockerfiles/packaging/guice/cassandra/scripts/james.rpm.postremove ---------------------------------------------------------------------- diff --git a/dockerfiles/packaging/guice/cassandra/scripts/james.rpm.postremove b/dockerfiles/packaging/guice/cassandra/scripts/james.rpm.postremove index d70a3ed..ed29fa9 100644 --- a/dockerfiles/packaging/guice/cassandra/scripts/james.rpm.postremove +++ b/dockerfiles/packaging/guice/cassandra/scripts/james.rpm.postremove @@ -5,3 +5,5 @@ systemctl stop james systemctl disable james rm /etc/systemd/system/james.service +update-alternatives --remove james /usr/share/james/james-ldap-server.jar +update-alternatives --remove james /usr/share/james/james-withoutldap-server.jar http://git-wip-us.apache.org/repos/asf/james-project/blob/7aa3aec9/dockerfiles/packaging/guice/cassandra/scripts/package.sh ---------------------------------------------------------------------- diff --git a/dockerfiles/packaging/guice/cassandra/scripts/package.sh b/dockerfiles/packaging/guice/cassandra/scripts/package.sh index da86f36..58a95b5 100755 --- a/dockerfiles/packaging/guice/cassandra/scripts/package.sh +++ b/dockerfiles/packaging/guice/cassandra/scripts/package.sh @@ -23,6 +23,7 @@ fpm -s dir -t deb \ -C package \ --deb-systemd james.service \ --after-install james.postinst \ + --after-remove james.postremove \ --provides mail-transport-agent \ --provides default-mta \ --iteration $ITERATION \ @@ -58,4 +59,4 @@ fpm -s dir -t rpm \ . cp /packages/james*.deb /result/ -cp /packages/james*.rpm /result/ \ No newline at end of file +cp /packages/james*.rpm /result/ --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
