What is Jenkins?

"Jenkins provides continuous integration services for software development, primarily in the Java programming language. It is a server-based system running in a servlet container such as Apache Tomcat. It supports SCM tools including CVS, Subversion, Git, Mercurial and Clearcase, and can execute Apache Ant and Apache Maven based projects as well as arbitrary shell scripts and Windows batch commands. The primary developer of Jenkins is Kohsuke Kawaguchi. Released under the MIT License, Jenkins is free software." - from Wikipedia

In plain English, Jenkins allows you to automate the testing of software. Software tests can be written in basically anything and then executed through shell scripts. The tests can be triggered manually, on a schedule, or when new code is committed to the repository. Jenkins supports CVS, SVN, Git, Mercurial, and Clearcase either natively or through plugin support.



  • Download the latest version
  • Run it with java -jar jenkins.war
  • Access Jenkins Dashboard through localhost:8080
  • Open up the Jenkins Dashboard in a browser.
  • From home page: Manage Jenkins -> Manage Plugins -> Available Plugins
  • Install "Github Plugin"

Configuration with GitHub

  • Go to Jenkins global configuration page: Manage Jenkins -> Configure System
  • Configure the GitHub Web Hook either manually per repo or for automatic configuration (see this link for more details)
  • Once configured correctly, github will send a HTTP POST message to Jenkins whenever a commits are pushed to the repository.

Test Job

  • Create an empty github repository and ensure either the repo is configured to send Web Hooks to Jenkins, or you've correctly configured Jenkins to do so automatically (see above section).
  • Create a new Job with the title "jenkinsTest" (or whatever you feel like calling it) and select the "Build a free-style software project" option.
  • Under "Source Code Management" select "Git" and enter the URL of the github repository
  • Under "Build Triggers" check off "Build when a change is pushed to GitHub"
  • Under "Build" add an "Execute Shell" Build Step (or whatever is appropriate), and enter the following text: python pyUnit.py
  • Clone a local copy of your git repo: git clone git://github.com/username/reponame.git
  • Download and add the file pyUnit.py: git add pyUnit.py
  • Commit the changes: git commit -m "A basic unit test"
  • Push changes up to github: git push origin master
  • Now monitor the Jenkins Dashboard and you should see that a new build should start automatically and pass..
  • Note: Jenkins does not support SSH keys with a passphrase. So if you have the terminal window where Jenkins was started open, you should check if it's waiting for a passphrase entry. To avoid the prompt, use ssh-agent (the command is ssh-add), or use a passphraseless SSH key.
  • To test a failed build: modify pyUnit.py so that the assertion looks like self.assertEqual(1,0), then commit and push the changes to github.

-- AndreyPolyakov - 2011-10-19

Topic attachments
I Attachment History Action Size Date WhoSorted ascending Comment
Texttxt pyUnit.py.txt r1 manage 0.3 K 2011-10-20 - 16:51 UnknownUser  

This topic: HEPrc > VirtualizationProjectHome > JenkinsConfiguration
Topic revision: r3 - 2011-12-16 - andpol
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback