In this article am going to explain about Jenkins. So what is jenkins?
Jenkins is the leading open source continuous integration server. Built with java. Jenkin is a CI so first we need to know what is continuos integration. Nowadays developers are working from different corners of the world. When same code is modified by different users the chance for conflicts are very high, this consume large amout of time to solve the issue.To avoid this we use continuos integration. This is a practice of merging all developers working copies into a repository many times aday. There are different continuous integration tools available, some of them are Bamboo, Apache Continuum, DeployBot, Hudson, Jenkins etcSo many continuous integrations tools are available then why we choose Jenkins?
Jenkins is an extensible continuous integration engine forked from Hudson and Hudson team has moved to develop Jenkins, large number of plugins are available in Jenkins and the authers are choosen to support their plugins on Jenkins, Jenkins make incremental itrative improvement to the code, Jenkins provide hundreds of plugins to support building,testing,deploying and automatin for any projects. Plugins have been released for jenkins that extend its use to projects written in language other than java. Plugins available for integrating jenkins with most version control systems and big database. Plugins can also change the the way jenkins looks or add new functionality.These are some features of the Jenkins that make it user-friendly…
1. Easy installation: For installation run java-jar jenkins.war, deploy it in a servelet container. No additional installation or database is needed. 2. Easy configuaration: Using its user friendly GUI we can easily configuare the jenkins 3. Plugins: There are 100s of plugins available for jenkins. Most part of the jenkins can be extended and modified 4. Distributed builds: jenkins can distribute to multiple computers with differentt operating systemsThese are the steps to install Jenkins on ubuntu
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt-get update sudo apt-get install jenkinsuse these for installing jenkins in ubuntu
Configuring jenkins
After the proper installation of the Jenkins next we need to create a new project and configure the same. For creating a new project in jenkins go to the dashboard click on the ‘New Item’ and set your project as your need. for configuring jenkins get into that project and go to the ‘configure tab in the left sidebar’. We can set our project_name, description slack notifications etc in this page. We can set our repository address deploying address etc in this.By using plugins we can add more features to it. After configuring save the changes and click ‘build now’ to build. After this jenkins will show whether the build is succeed or not by whether build trend. Jenkins can execute shell scripts, bash script and Ant targets.Jenkins plugins
The most important feature of Jenkins is its plugins, so lets have a look through it.. plugins are very helpful while accessing the project. Different types of plugins are availabe for integrating jenkins. We can add new functionality using plugins. We can install existing plugins and create new plugins. Now lets have a look at how to install plugins. There 3 ways to install a plugins 1) installing the newest version 2) installing a specific version 3) installing by handinstalling the newest version
click on the ‘manage plugin’ in the ‘manage Jenkins’ go to the availabe tab select which plugin should be installed from available plugin then attempt ‘install without restart’installing a specific version
download the older version of plugin. Upload it from your computer on ‘advanced tab’ of the ‘manage plugin’ pageinstalling by hand
save the downloaded .hpi/.jpi into the $jenkins_home directory plugin. You will need to restart your computer.Create plugins
As i said earlier we can also create plugins in Jenkins, only few steps are needed for creating a plugin to start the plugin use the following$ mvn -U org.jenkins-ci.tools:maven-hpi-plugin:createthis will ask you few questions like groupid artifactid.
$ cd newly-created-directory $ mvn packagethen we need to build the plugin for that just run mvn install
Useful jenkins plugins
- build flow
- build monitor
- build name setter
- build pipeline
- email extension
- git
- SSH
- heroku
- priority sorter
- checkstyle