Showing posts with label Hudson. Show all posts
Showing posts with label Hudson. Show all posts

Saturday, 14 December 2013

Setup Jenkins Continuous and Automatic Build System

Jenkins is an open source tool which provides continuous integration services for software development. If you want to get more detail about Jenkins and it's history I would suggest refer this link. This post will help you installing and configuring Jenkins and creating jobs to trigger maven builds. Setting up Jenkins is not a rocket science indeed. In this post, I would like to concise the installation and configuration steps.


Installing Jenkins
Though, there are different ways to install Jenkins. But, in this post I will be describing Jenkins installation with Apache Tomcat server. Hence, please make sure that you have Apache Tomcat.   
  1. Download Jenkins war file from here and copy war into tomcat's 'webapp' folder
  2. Start the tomcat server and access Jenkins

Jenkins installation is done. Wow, so easy. Isn't it?

Configuring Jenkins
Now you have Jenkins running with you. It's time to configure the project specific environment for continuous and automatic build. This section describes about JDK, Maven and Mail Notification configuration.

Go to 'Manage Jenkins' 

 

Go to 'Manage Jenkins > Configure System'




Creating Job for Automatic and Continuous Build
So far you installed and configured  the Jenkins. It's time to create new job. Before creating new job ensure that your project is a maven project. Now, go to 'New Job' and fill the required information. I believe, below screen shot tells everything which is required to configure a job. You just need to configure below points at minimum:
  • Source Code Management
  • Build Triggers
  • Build
  • Notifications





Once you save the job you will see below screen


Now click on 'Build Now' and see the 'Build History'. You will get new entry in 'Build History'. To see the build logs just hover the mouse on this build and click on 'Console Output', you can see the build logs.



Congratulations! you are done with setting up continuous build system.If you want to see that how effectively it works, just check-in any file in your project and see whether your build is triggered automatically. In case, build is failed with latest checked-in changes you must get a notification mail saying build is failed.

Last but not least, you should agree with my point 'Setting up Jenkins is not a rocket science indeed'. Shouldn't you? :) :) :)

Saturday, 30 November 2013

Hudson Plugin for Eclipse

If you are using Hudson as continuous integration server and you might feel lazy about accessing Hudson explicitly to check the build status or checking Hudson build status mails, there is an option to monitor Hudson build and perform build activities in Eclipse IDE itself. This post describes about installing, configuring and using the Hudson in Eclipse IDE.

Installing Hudson Plugin in Eclipse
Use below URL To install the Hudson Eclipse plugin using Eclipse Update Manager:

In case you face issue while installing plugin using update manager you can directly drop dk.contix.eclipse.hudson_x.x.x.jar  in Eclipse's plugins directory and restart IDE.

Configuring Hudson 
Once the installation is done, configure the Hudson URL from Preferences > Hudson to connect to Hudson server. Also remember to Check URL whether URL is valid or not. Your Hudson server must be running at this point of time.


How to Use Hudson in Eclipse?
In eclipse, go to Windows > Show View > Hudson. You will see below tab is added in your Eclipse. Also, When the plugin is running, a health icon is displayed at the bottom of the Eclipse window. The icon is red on build failure and green on success.  Please note that due to limitations in Eclipse, the Hudson view must be active before the icon is displayed.


In case build is failed, you will get below pop-up in your eclipse IDE. 


You can also perform below activities using this Eclipse Hudson plugin.For this, select any project listed in Hudson tab and right click.
  1. Schedule New Build
  2. View Console Output
  3. Open Hudson in Browser


If you want to  access the Hudson admin console in your Eclipse,  go to 'Hudson' tab and double click on your project.


Limitations 
If your Hudson server requires authentication and authorization for access, then you can not see the list of jobs in Eclipse. Because Eclipse Hudson plugin does not facilitates interface to provide Hudson web credentials. To overcome this limitation, you have to give read permission to Anonymous user for jobs in Hudson which need to be displayed in Eclipse. 

Common Issues
  •  Issue in configuring Hudson base URL which is SSL enabled
Solution: This issue is due to missing required certificates. Refer below links to generate the certificate. Once the certificate is generated you can copy those into $JAVA_HOME/lib/security for the JRE that eclipse is using for its run time. It will trust that cert and then you can access configured HTTPS URL successfully.

  • Once your certificate issue is resolved then you may face below issue
             java.security.cert.CertificateException: No subject alternative names present

            Solution: Configure HTTPS URL using DNS rather giving IP address.
             For example: Use this https://mybox.com/hudson instead of  https://XX.XX.XX.XX/hudson 
  • While refreshing build status you get below pop-up 

            Solution: Ensure that your job's name in Hudson does not contain white spaces.

References
Below are the references for more detail about Hudson Eclipse plugin.