Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Continous Integration(Tools and best practices around Continuous Integration for Virgo Projects)
Continous Integration [message #663818] Wed, 06 April 2011 11:00 Go to next message
Matt Fellows is currently offline Matt Fellows
Messages: 28
Registered: February 2011
Junior Member
I was wondering if anyone could provide some advice regarding a good CI setup for Virgo; including building and automating deployment using Jenkins (formerly Hudson)?

I have setup a multi-bundle project, including a WAB, using Pax-Construct to help manage Maven. Lot's of wrapped JAR's and I found Pax-Construct to be really useful in keeping things consistent.

I've mostly follows the suggestions made here: http://www.eclipse.org/virgo/documentation/virgo-documentati on-2.1.0.RELEASE/docs/virgo-getting-started/htmlsingle/virgo -getting-started.html#automated.build, and Maven will handle most of those needs excepting the deployment into the Virgo container itself.

I've currently resorted to an Ant script that runs after the Maven goal execution in the Jenkins build to remove old artifacts, copy the new artifacts into the usr repository and the pickup dir. It kind of does the trick but Virgo can be flakey when hot deploying a JSF application so I need to stop\start the server as part of that process now, and setup monitoring to check that the application is indeed running.

Any ideas would be much appreciated.

Cheers,
Matt
Re: Continous Integration [message #663969 is a reply to message #663818] Wed, 06 April 2011 21:03 Go to previous messageGo to next message
Brad Chen is currently offline Brad Chen
Messages: 7
Registered: April 2011
Junior Member
I also happen to be using Jenkins to push projects to the staging server, and I also use the pickup/ route. What I do to make sure that bundles can get unloaded and loaded properly is that I wait a few seconds between each operation.

For example, I have the following bash snippet for unloading the bundles:

# Remove Bundles
rm -f /usr/local/virgo-tomcat-server/pickup/wab-*.war
sleep 20
rm -f /usr/local/virgo-tomcat-server/pickup/persistence-*.jar
sleep 10
rm -f /usr/local/virgo-tomcat-server/pickup/service-bundle1-*.jar
rm -f /usr/local/virgo-tomcat-server/pickup/service-bundle2-* .jar
rm -f /usr/local/virgo-tomcat-server/pickup/service-bundle3-*.jar
sleep 10

For loading, I have the following:

# Install bundles
cp $WORKSPACE/service-bundle1/target/service-bundle1- *.jar \
/usr/local/virgo-tomcat-server/pickup
cp $WORKSPACE/service-bundle2/target/service-bundle2-*.jar \
/usr/local/virgo-tomcat-server/pickup
cp $WORKSPACE/service-bundle3/target/service-bundle3-*.jar \
/usr/local/virgo-tomcat-server/pickup
sleep 10
cp $WORKSPACE/persistence/target/persistence-*.jar \
/usr/local/virgo-tomcat-server/pickup
sleep 10
cp $WORKSPACE/wab/target/wab-*.war \
/usr/local/virgo-tomcat-server/pickup
sleep 20

Then, to make sure changes work, Site Monitor Plugin is used. So far, this technique has been quite reliable for a few weeks. Though, it would be great if Virgo can have CLI commands, like Glassfish's asadmin, that handles bundle loading and unloading.

Hope this helps.

[Updated on: Wed, 06 April 2011 21:07]

Report message to a moderator

Re: Continous Integration [message #663975 is a reply to message #663969] Wed, 06 April 2011 22:56 Go to previous messageGo to next message
Matt Fellows is currently offline Matt Fellows
Messages: 28
Registered: February 2011
Junior Member
Thanks Brad,

I've considered the 'wait' command, but it can sometimes depend on the load of the server as to how long a stopping event is handled by Virgo.

I might give that a go anyway.

I second the idea for a CLI for remote bundle management, I think that's a great idea. Perhaps I'll raise a change request in Bugzilla.

Cheers,
Matt
Re: Continous Integration [message #664114 is a reply to message #663975] Thu, 07 April 2011 10:05 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 271
Registered: January 2010
Senior Member
There is a way to do what you want with some jruby love.

Have a script that does deployment with JMX commands for example.

Just a thought.

Dmitry
Re: Continous Integration [message #664231 is a reply to message #664114] Thu, 07 April 2011 19:05 Go to previous message
Matt Fellows is currently offline Matt Fellows
Messages: 28
Registered: February 2011
Junior Member
Sounds like a good alternative.

Would love to see your JMX script if you're able to share it?

Cheers,
Matt
Previous Topic:[Solved]Help with import-package
Next Topic:Swing applications based on Virgo
Goto Forum:
  


Current Time: Mon Jul 28 02:21:58 EDT 2014

Powered by FUDForum. Page generated in 0.02275 seconds