Dienstag, 17. Januar 2017

CoreMedia Build Docker

CoreMedia releases 7 and 8 had one very nice advantage: You didn't have to install anything else than stock Java and Maven to be able to build the workspaces.

Where we come from

This is one of the reasons, why it was possible to use standard services like travis-ci and Gitlab CI with their current container based approach to build these rather large and complex workspaces. Official docker containers for maven just did the job.

GitLab CI example to build a CoreMedia 7 workspace:
image: maven:3-jdk-7

stages:
  - build

build_modules:
  stage: build
  script:
  - mvn install -s workspace-configuration/maven-settings.xml -B

  artifacts:    paths:
    - packages/*/*/target/*.rpm
    expire_in: 3 days
    name: ${CI_BUILD_STAGE}-${CI_BUILD_REF_NAME}


cache:
  paths:
  - mvnrepo/


Where we go to

With the upcoming new CoreMedia platform for CMS and LiveContext this again changes a bit. And that bit is really that tiny, that I didn't want to lose the possibility to use the container based CI tools and go back to Jenkins (which is, what my customers provide me with).
That being said a basic docker file is prepared very quickly to include
Java 8
Maven 3
PhantomJS
The missing part is the command line tool for Sencha ExtJS, the framework the CoreMedia studio heavily relies on. This tool comes with a graphical installer and cannot be installed script based (as far as I can see).
Since I already installed that tool locally, I decided to write a little preparation script, to convert the installation to a copy-able artifact, changing an absolute symbolic link to a relative one.

Prepare a copy-able sencha Cmd copy:
S=`which sencha`
DIR=`dirname $S`
(cd build ; cp -rdp $DIR .)

SD=`(cd build/Cmd ; find -type d -name "6\.[0-9]*")|sed -e 's/^.\///g'`
(cd build/Cmd ; rm sencha-$SD ; ln -s $SD/sencha sencha-$SD)


What's left

Left out intentionally is the authentication part for maven with the CoreMedia repositories and the integration with GitLab CI, what I will be using, since these two are not really generic.

How to get it

As usual you find the sources for this small code piece on GitHub to clone, fork, and use it. And also as usual feedback is highly welcome.

Keine Kommentare:

Kommentar veröffentlichen