Public | Automated Build

Last pushed: 3 months ago
Short Description
Some containers used in eXo CI environment
Full Description

eXo Docker Images for CI


The aim of this repository is to give the configuration to build all eXo Platform components in Docker containers for Development and Continous Integration purpose.

It contains Dockerfiles, Tests and configuration for the following CI Images:

Image JDK Build tool Tests
exoplatform/ci:base n/a n/a goss.yaml
exoplatform/ci:jdk6 1.6.0_45 n/a goss.yaml
exoplatform/ci:jdk7 1.7.0_79 n/a goss.yaml
exoplatform/ci:jdk8 1.8.0_92 n/a goss.yaml
exoplatform/ci:jdk8-gradle2 1.8.0_92 Gradle 2.14 goss.yaml
exoplatform/ci:jdk8-gradle2-android 1.8.0_92 Gradle 2.14 / Android 23/24 goss.yaml
exoplatform/ci:jdk8-gradle4 1.8.0_92 Gradle 4.1 goss.yaml
exoplatform/ci:jdk8-gradle4-android 1.8.0_92 Gradle 4.1 / Android 23/24/25/26/27 goss.yaml
exoplatform/ci:jdk6-maven30 1.6.0_45 Maven 3.0.5 goss.yaml
exoplatform/ci:jdk6-maven32 1.6.0_45 Maven 3.2.5 goss.yaml
exoplatform/ci:jdk7-maven30 1.7.0_79 Maven 3.0.5 goss.yaml
exoplatform/ci:jdk7-maven32 1.7.0_79 Maven 3.2.5 goss.yaml
exoplatform/ci:jdk8-maven30 1.8.0_92 Maven 3.0.5 goss.yaml
exoplatform/ci:jdk8-maven32 1.8.0_92 Maven 3.2.5 goss.yaml
exoplatform/ci:jdk8-maven33 1.8.0_92 Maven 3.3.9 goss.yaml


This diagram show an overview of the inheritance in eXo CI Docker images:

How to execute tests?

To run tests, you have to install dgoss

You can build and test all images by running the script:

$ ./

If you want to execute test on a specific Docker image:

$ cd maven/jdk7-maven32/tests
$ ./

Then you should have a log like below:

INFO: Starting docker container
INFO: Container ID: 59897f6f
INFO: Sleeping for 0.2
INFO: Running Tests
Title: Validating the presence of eXo GLOBAL settings file
File: /usr/share/maven/conf/settings.xml: exists: matches expectation: [true]
Title: Validating the presence Maven repository folder
File: /home/ciagent/.m2/repository: exists: matches expectation: [true]
Title: Validating the absence of eXo USER settings file
File: /home/ciagent/.m2/settings.xml: exists: matches expectation: [false]
Title: Check that git is installed
Package: git: installed: matches expectation: [true]
Command: mvn --version: exit-status: matches expectation: [0]
Command: mvn --version: stdout: matches expectation: [3.2.5 1.7.0 Default locale: en_US, platform encoding: UTF-8]

Total Duration: 0.650s
Count: 6, Failed: 0, Skipped: 0
INFO: Deleting container

real    0m2.929s
user    0m0.064s
sys     0m0.288s

How to use a eXo CI Docker Image?

Basic Example with JDK7 - Maven 3.0

$ cd my-project
$ docker run --name=my-project-build -it -v $(pwd):/srv/ciagent/workspace \
     -v ~/.m2/repository:/home/ciagent/.m2/repository \
     -v ~/.m2/settings.xml:/home/ciagent/.m2/settings.xml \
     exoplatform/ci:jdk7-maven30 clean package

Advanced example with JDK8 - Maven 3.2 and Release Profile

$ cd my-project
$ docker run --name=my-project-build -it -v $(pwd):/srv/ciagent/workspace \
     -v ~/.m2/repository:/home/ciagent/.m2/repository \
     -v ~/.m2/settings.xml:/home/ciagent/.m2/settings.xml \
     -v ~/.gnupg/pubring.gpg:/home/ciagent/.gnupg/pubring.gpg:ro \
     -v ~/.gnupg/secring.gpg:/home/ciagent/.gnupg/secring.gpg:ro \
     -v ~/.gnupg/gpg.conf:/home/ciagent/.gnupg/gpg.conf:ro \
     exoplatform/ci:jdk8-maven32 install -Prelease

How to use eXo Puppet Docker Image

$ cd my-project
$ docker run --name puppet-validation -it -v ${PWD}:/srv/ciagent/workspace \

You can specify the -u option to force the modules update via r10k
Example :

docker run --name puppet-validation -it -v ${PWD}:/srv/ciagent/workspace \
      exoplatform/ci:puppet -u


XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files using simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands.

At eXo, we use it to update Maven POM XML files for FB and Translation process.


$ cd /tmp/xmlstarlet
$ wget
$ docker run -it --rm --name=xmlstartlet  -v $(pwd):/srv/ciagent/workspace --entrypoint=/bin/bash  exoplatform/ci:jdk8-maven32

# Update POM version from X-SNAPSHOT to X-translation-SNAPSHOT
ciagent@b32b684a1d6b:/srv/ciagent/workspace$ xmlstarlet ed --inplace -N pom= \
  -u '/pom:project/pom:version[contains(text(), "-SNAPSHOT")]' \
  -x "concat(substring-before(.,'-SNAPSHOT'), '-translation-SNAPSHOT')" \

# Update all POMs files in a Maven reactor project
ciagent@b32b684a1d6b:/srv/ciagent/workspace$ find . -name pom.xml | xargs -t -n 1 xmlstarlet ed -P --inplace -N pom= -u '/pom:project/pom:version[contains(text(), "-SNAPSHOT")]' -x "concat(substring-before(.,'-SNAPSHOT'), '-translation-SNAPSHOT')"

Developer configuration

Configure your .bash_profile

In order to quickly run build with different stack (Maven and JDK), you can configure your .bash_profile file
with the following alias:

# Run Maven commands in Containers

      mvnInContainer "exoplatform/ci:jdk8-maven33" "$@"
      mvnInContainer "exoplatform/ci:jdk8-maven32" "$@"

      mvnInContainer "exoplatform/ci:jdk8-maven30" "$@"

      mvnInContainer "exoplatform/ci:jdk7-maven32" "$@"

      mvnInContainer "exoplatform/ci:jdk7-maven30" "$@"

      mvnInContainer "exoplatform/ci:jdk6-maven30" "$@"

# Run Maven commands in a container
      local dockerImage=$1

      docker run --rm \
        -v $(pwd):/srv/ciagent/workspace \
        -v ~/.gnupg/gpg.conf:/home/ciagent/.gnupg/gpg.conf:ro \
        -v ~/.gnupg/pubring.gpg:/home/ciagent/.gnupg/pubring.gpg:ro \
        -v ~/.gnupg/secring.gpg:/home/ciagent/.gnupg/secring.gpg:ro \
        -v ~/.gnupg/trustdb.gpg:/home/ciagent/.gnupg/trustdb.gpg:ro \
        -v ~/.gnupg:/home/ciagent/.gnupg \
        -v ~/.m2/repository:/home/ciagent/.m2/repository \
        -v ~/.m2/settings.xml:/home/ciagent/.m2/settings.xml \
        --workdir /srv/ciagent/workspace \
        ${dockerImage} "${@:2}"
docker run --name puppet-validation -it -v ${PWD}:/srv/ciagent/workspace \
      exoplatform/ci:puppet $*

Build with the right configuration

$ source ~/.bash_profile
$ cd my-project
$ jdk8mvn32 clean package
Docker Pull Command
Source Repository