HowTo - Continuous Integration and Test Workflow

Additional Servicemix Setup

The perm gen space of Servicemix has to be increased. This can be done by setting the JAVA_OPTS environment variable before starting Servicemix.

  JAVA_OPTS="$JAVA_OPTS -XX:PermSize=256m -XX:MaxPermSize=256m -Xmx1024M"

Setting up the example

In this example a workflow shall be used to model the behaviour, which is triggered by a rule. Copy the example flow core/workflow/service-engine/src/main/resources/ci.rf to $SERVICEMIX_HOME/data/openengsb/rulebase/org/openengsb

To reload the rulebase either restart servicemix or create a file names "reload" in the rulebase-directory

cp core/workflow/service-engine/src/main/resources/ci.rf $SERVICEMIX_HOME/data/openengsb/rulebase/org/openengsb
touch $SERVICEMIX_HOME/data/openengsb/rulebase/reload

To configure the email address to which the report will be sent, set the value 'contextId/workflows/ci/notification/recipient' in the context. This can be done by the test client.

Create two additional rules and save them to $SERVICEMIX_HOME/data/openengsb/rulebase/org/openengsb

scmcheckin.rule

  when
    e : ScmCheckInEvent ()
  then
    droolsHelper.runFlow("ci");

and sendAllEvents.rule

  when
    e : Event()
  then
    String namespace = config.getNamespace(report);
    String service = config.getEventServiceName(report);
    eventHelper.sendEvent(e, namespace, service);

The first rule states that whenever an event of type ScmCheckInEvent happens the workflow with the id 'ci' shall be started. The second rule forwards every event to the report domain.

To reload the rulebase either restart servicemix or create a file names "reload" in the rulebase-directory

Setting up Subversion Repository

To generate ScmCheckIn events, you will need to set up a subversion repository.

When you are done, configure the svnConnector to poll your repository.

Running the example

1. Start servicemix.

2. Run quickrun.sh or mvn clean install and then scripts/deploy.sh

3. Trigger an ScmCheckInEvent.

The ScmCheckIn Event

To create a ScmCheckIn event commit anything to your svn repository.

The ci workflow will try to build any project found in the data/openengsb/testProject folder (servicemix), so drop a project there to test the workflow.