LiveRebel Deploy Plugin How-To for Hudson/Jenkins

LiveRebel Deploy Plugin is a Jenkins/Hudson plugin that lets you configure deployments from your continous integration server. This assists in your continuous deployment process, by allowing you to deploy your application to your application servers without any downtime or OutOfMemoryErrors, directly from within your continuous integration server. Effectively, it acts as the glue between Jenkins and the LiveRebel Command Center using the LiveRebel API in the backend.

For ease-of-reading, I’ll just write “Jenkins” throughout this article, but it is indeed a plugin for both. If you are already using the Deploy Plugin that Jenkins offers then this how-to will be really easy for you to follow.

We presume that you are already running a LiveRebel Command Center. If not then head over to LiveRebel Installation and Configuration Walkthrough.

Lets start off by installing the LiveRebel Deploy Plugin in Jenkins. It’s available from the plugin management page (Jenkins » Manage Jenkins » Manage Plugins). Switch to the Available tab and look for LiveRebel Deploy Plugin. Tick the checkbox, press install, restart Jenkins and voila, the plugin is installed.

Once you’ve installed the plugin lets configure it. All Jenkins jobs will use the same LiveRebel Command Center instance for deployments. We need to provide the authentication token and the url of the Command Center. Navigate to Jenkins » Manage Jenkins » Configure System. You should see a new section there, called LiveRebel Deploy Plugin.

Provide the LiveRebel Command Center URL and the authentication Token (How do I get a LiveRebel Authentication Token?). After you have provided the necessary information you can check if Jenkins is able to connect to the Command Center, press Test Connection.

We can now proceed configuring the actual Jenkins job that will deploy an artifact. In you Job configuration page you should see a new checkbox under Post-Build Actions.

Lets define the artifact that you want to deploy (WAR or EAR file). The path should be relative to your workspace folder. Several artifacts can be separated with commas. Remember: To deploy artifacts with LiveRebel they need to have the liverebel.xml marker file, see How to get started with LiveRebel (FAQ#13) for more information.

On each build, LiveRebel will take the artifact(s) that you have defined and run a compare operation on the artifact and the previously deployed one. If the compare shows that LiveRebel supports the change (Compatible) then the LiveRebel backend is used to run the update. If not, then we fallback to the Deploy Plugin. Here’s the deal: LiveRebel might not support some of the changes you want to make, due to the need to re-initialize class x, or a field or a resource, etc – so it tells you directly that this change might not be supported, with a warning. If you want it to update the applications even when LiveRebel provides warnings (eg: you know what you’re looking to change, and those are irrelevant for you) then check the corresponding checkbox.

I have configured my job like this: an artifact with a path target/rebel-chat.war, enabled the updates when compare is even with warnings and falls back to Cargo when LiveRebel does not support the update.

This is the output that you should see in your Jenkins job when the job gets executed.

Now you are all set to run updates with LiveRebel from your continous integration server. If you have any questions head over to the LiveRebel forums or drop us an email at liverebel@zeroturnaround.com.

Join the Rebellion Facebook Twitter RSS feed