Blogroll

I’ve been investigating lately what to do with a bundle, once it’s released:

Should I automatically deploy it into a Staging or Production server ?

Should I deploy it into another repository and then use Felix Web Console to deploy it manually ?

Automation is always good, but in conditions where before reaching Production there is a Staging / Pre-production environment, the #1 option doesn’t seem to fit. Therefore I’ve been looking on solutions for #2.

The idea that attracted me the most was to use an OBR ( OSGI Bundle Repository ). Felix Web Console has already an OSGI Repository section, which can connect to a remote OBR and let admin users install OSGI bundles right from the administration page.

I’m going to describe what I’ve done in order to achieve this.

Create an empty OBR.

For this I configured a new subdomain : obr.mydomain.com, in one of my development machines. I’ve linked the subdomain to

If you’ve performed a maven release before, release:prepare and release:perform should be familiar to you. I’ll explain the other options.

-DremoteOBR – it’s an ID I gave to the OBR repository.

-DobrDeploymentRepository – defines the OBR repository: OBR_ID::layout::url .
I’ve used the “default” layout and the URL points to a local file, b/c Jenkins who executes the maven command runs on the same machine with the OBR.

-DprefixUrl – it’s the prefix used in the URL to the JAR bundle. Without this prefix the URL would look like “file:/com/x/y/myBundle.jar” and people won’t the able to download the actual bundle.
I’ve then pointed my prefix to the Nexus Maven repository. During the maven release the bundle is deployed in that Nexus repository anyway, so I’v added it as a prefix for my bundle. With the prefix the URL looks like “http://nexus.mydomain.com/nexus/content/repositories/releases/com/x/y/myBundle.jar”.

After a maven release, check if the OBR contains the update. Open the URL

http://obr.mydomain.com/repository.xml

again and the information should be there. Here is a sample repository.xml: