Liferay Jenkins

Hi,

 

today i have done integration of jenkins using liferay 6.2.

while setup jenkins need to be follow below steps:

  1. Download Jenkins software using below URL

URL : https://jenkins.io (select downloads button on navigation bar)

 

  1. Extract zip file and run Jenkins.exe file then put default password after installation

          File Name : Program Files (x86)\Jenkins\secrets\initialAdminPassword

  1.    Now setup your Jenkins server and install some required plugins after login with http://localhost:8080  (default url for Jenkins)
  2. Now setup admin account using jenkins server as below :

Then click on save and finish.

  1. Start jenkins as below :

You can see below screen after starting jenkins

 

  1. Click on Manage Jenkins -> Configure System (see below image)

  1. Configure Maven, Java and others:   As shown in below, Set JAVA_HOME path with system JDK path and set Maven, ANT also(use global tool configuration option)

 

 

 

You can configure other tools as well then click on save button.

 

 

 

  1. Set  SMTP server details for email communication as below(use configure system option)

 

Then click on save button.

 

SVN and Build Job Configuration

  1. 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.

                    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 folder  in user Documents folder in windows machine)  

 

  1. Give some name and select as free style project and click on “Advanced” under General Tab Options.need to be click on free style project then you can able see below screen

  1. Click on “Advanced Option” to configure custom workspace for your project in case if  you don’t want it to reside in JENKINS_HOME folder. Select User Custom Workspace and give complete path in Directory

             Ex. F:\Liferay Projects 2015\Liferay Jenkins\jenkins_workspace

Then click on save button.

  1. In above screen you can see source control management option there you can configure your source code repository

Then click on save button

 

  1. 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. 

Then click on save button.

  1. 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.
  1. In target section: give ant command “all”. Liferay SDK build.xml as “all, zip-portal, clean, deploy, war, ear, compile, build-service” targets.
  2. Build File: If you want to use liferay-plugin-sdk build file, then give the  workspace\liferay-plugin-sdk\build.xml file rather custom file. Make sure that you copy  build.{user-name}.properties file into that folder.
  3. Properties: Suppose, you might want to generate build with SVN Revision number. This is where you need to inject properties into build.xml file. 

Note : make sure that need to configure ANT first using global tool configuration Option        

  1. 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”.

Click on save button.

  1. So once you deploy your portlet in will reflect your jenkin server.
  2. Now we have configured successfully jenkin server with Liferay.

Thanks,