Liferay Jenkins Integration

Liferay Jenkins Integration tutorial will help to configure build and deployment process for Liferay 6.2 PluginSDK. Liferay jenkins integration is series of 3 tutorials focus on automating building of deployment artifacts. As you all know, applications are required to configured with CIS process  to automate build and deployment process to increase  productivity.

What is Jenkins?

Jenkins project is forked from Hudson and used to automate build and deployment. Its server-based system running in tomcat  in Java.

Jenkins Installation and setup

  • Jenkins Installation: Click on the below tutorial for Jenkins installation

    Jenkins setup and Installation

    Jenkins setup and  Installation What is Jenkins? Jenkins is open source server to automate build, test, and deployment of applications. Installations: Apache tomcat Jenkins 2.5.1 Jenkins Setup:READ MORE

  • Jenkins Configuration Setup:  In this step, we will configure java, ant and maven with jenkins. Click on the below tutorial for Jenkins Configuration

    Jenkins Configuration Setup

    Jenkins Configuration Setup Jenkins setup tutorial will guide on installing Jenkins locally. In this tutorial we will manage Jenkins configuration.READ MORE

SVN and Build Job Configuration

Jenkins need to be configured with SVN, where your project plugin sdk is exists. In general, Liferay Plugin SDK will be created in SVN to hold Portlet, Theme, Layout, Hooks and EXT plugins. Liferay plugin SDK has robust support for ANT build scripts. In this section, We will look into SVN configuration and building whole plugin SDK.

  1.  In Jenkins home page, click on “New Item”. This action will create a project in Jenkins, technically  which would create workspace folder in JENKINS_HOME(JENKINS_HOME  is a .jenkins folderfolder  in user Documents folder in windows machine)              image2
  2. Give some name and select as free style project and click on “Advanced” under Advanced Project Options.SVN_JOB
  3. Click on “Advanced Project Settings” to configure custom workspace for your project in case if  you don’t want it to reside in JENKINS_HOME folder. Select User Cusom Workspace and give complete path in DirctoryAdvancedProjectOptions
  4. In  same screen, you can see Source Code Management. If you don’t find this option then install SVN plugin into Jenkins(Navigate to Manage Jenkins -> Install or Update section to install new plugin).
    1. Select SubVersion and Provide Repository URL     and Select Check-Out Strategy.(Select any one of first two choices)SVN_Config
  5. Jenkins provides below  choices on “When to take late code from SVN”.   Select Poll SVN option to take update from SVN when developers commits code and give time frame that to poll SVN. Build Triggers
  6. Now we are done with  SVN configuration and In this step, we are about to configure Build actions and Post Build actions. build.xml file custom ant build script to build the liferay project as tar ball for clean deployment.
    • In target section: give ant command “all”. Liferay SDK build.xml as “all, zip-portal, clean, deploy,war,ear,compile,build-service” targets.
    • Build File: If you want to use liferay-plugin-sdk build file, then give the  workspace\liferay-plugin-sdk\build.xml file rather cutom file. Make sure that you copy  build.{user-name}.properties file into that folder.  In next tutorial, I will explain about custom build ant script which will automatically creates and makes whole liferay as tar ball.
    • Properties: Suppose, you might want to generate build with SVN Revision number. This is where you need to inject properties into build.xml file.build_instructions
  7. In general, you may have requirement to notify developers about SVN build status. Jenkins provides an option to notify developers through mail under “Post Build Actions”.                                  PostBuildActions                           In the next tutorial, we will discuss in detail in custom build scripts and automate deployment through Jenkins. Thanks and let me know if you have any questions.
7 thoughts on “Liferay Continuous Integration with Jenkins”
  1. Hi,

    SO if I want to deploy my portlets I need to have an instance of liferay on my jenkins build agent?

    I do not get it, could you please help me?

    1. Hi Rodrigo,

      There is no need of having Liferay instance on Jenkins Build agent. After building war files, you just need to two more post build tasks:
      1. Copy the artificats over SSH
      2. Run the deploy script for remote machine to which would extract the war files and will copy the war files to deploy folder of Liferay home directory

      Hope this Helps !!!

    1. We can configure Jenkins at portlet level by considering each portlet plugin as build project in Jenkins likewise plugin-sdk configured. Hope this helps!!

Leave a Reply