JENKINS TUTORIAL

Jenkins Integration Server

In the previous chapter, we studied the concept of "Continuous integration" aka "CI". In order to create an environment for a project with CI enabled, a tool is required for the same. Hence, Jenkins jumps into the action. Jenkins is an open source tool to make the continuous integration.

Jenkins was the project which was forked from Hudson due to some issues with the Oracle. Jenkins is basically a server based system running in a servlet container which is nothing but the apache tomcat. It supports many tools like Git, SVN, Mercurial and Clearcase. Jenkins was primarily started by a developer called Kuhsoke Kawaguchi.


What Jenkins does?

The primary job of the Jenkins is to execute a list of steps configured which is based on a trigger. Below are the list of steps/tasks performed by Jenkins when triggered :

  1. Perform the code compilation & build the software with ANT, Maven or Gradle.
  2. Run an internal shell script
  3. Archive the resultant builds
  4. At last start the execution of the integration tests.
  5. Monitoring the execution of the above tasks.
  6. Provision to stop the build in case of failure in any of the steps.
  7. Notifying the user about the success or failure of each build.

What Jenkins focus on?

Jenkins mainly focuses on 2 important activities :

  1. Continuous build of the software : Nothing but the creating a continuous integration environment
  2. Monitoring execution of external jobs : This monitors the jobs defined - CRON jobs.

Features of Jenkins

  1. Easy to install & configure.
  2. Permanent link - readable URLs for the build details.
  3. Email integration for notifications.
  4. JUnit tests reporting.
  5. Tagging support for every successful builds.
  6. Distributed builds.
  7. File fingerprinting for managing dependencies
  8. Plugin support

Jenkins Best Practices

Below are the list of some best practices to be made while working with Jenkins :

  1. Always secure Jenkins - user authentication.
  2. Use file fingerprinting to manage dependencies.
  3. Integrate Jenkins with the issue tracking systems like JIRA.
  4. Always configure Jenkins to generate a trend report.
  5. Setup Jenkins on a partitioned space where the disk space is more.
  6. Setup different jobs for maintenance and development projects.
  7. Archive unused jobs before deleting them.
  8. Setup email notification to all the developers of the team.
  9. Tag, Branch, Baseline after each successful build.