user3257435
user3257435

Reputation: 103

Deploy bundle in Servicemix from Jenkins

I'm trying deploying a bundle in Servicemix from Jenkins. The Use case is that When I make any changes locally, Jenkins build it and deploy it as bundle in servicemix (Which is running on Cloud).

I can deploy the bundles in servicemix locally which works fine but I'm now trying to figure out a way to deploy it from jenkins to Remote Servicemix.

Have anyone tried this?

Upvotes: 0

Views: 573

Answers (2)

рüффп
рüффп

Reputation: 5448

Does your Jenkins have access to the ssh console of ServiceMix (default port: 8101), if yes I suggest to send the commands through this channel.

Another possibility is to use the smx client ( ${smx_home}/bin/client ) and upload a script to be executed and then just execute the client through sh from Jenkins.

Upvotes: 0

Achim Nierbeck
Achim Nierbeck

Reputation: 5285

If you have the jolokia bundle installed you're able to use JMX via Rest calls.

{
"type":"EXEC",
"mbean":"org.apache.karaf:type=bundle,name=root",
"operation":"install(java.lang.String,boolean)",
"arguments":    ["mvn:${project.groupId}/${project.artifactId}/${project.version}", true]
}

To use this from jenkins I developed a small maven plugin which can be used like the following:

<plugin>
    <groupId>de.nierbeck.javaland.tools</groupId>
    <artifactId>karaf-deployer-maven-plugin</artifactId>
    <configuration>
        <url>http://192.168.59.103:8181/jolokia/</url>
        <jsonInstall>
{
"type":"EXEC",
"mbean":"org.apache.karaf:type=bundle,name=root",
"operation":"install(java.lang.String,boolean)",
"arguments":    ["mvn:${project.groupId}/${project.artifactId}/${project.version}", true]
}
        </jsonInstall>
        <user>karaf</user>
        <password>karaf</password>
       <skip>false</skip>
    </configuration>
</plugin> 

Upvotes: 2

Related Questions