Introduction to Jenkins
Jenkins is an open source DevOps tool which is basically use to automate repetitive tasks like code deployment on server. Main purpose of Jenkins is to do continuous integration and delivery of software.
Continuous Integration is a process where dev team writes their code and integrate it to a central repository like Git or SVN. This process required a continuous build process through which developers can deploy their code and unit test at a regular interval.
We can install Jenkins with basic sets of plug-ins. It can be extended by installing various plug-ins as per our requirement. For example if we want to use Git with Jenkins we can install the git plug-in or if we need SonarQube to test the code quality before the deployment then we can install the plug-in for SonarQube. I will cover the integration with SonarQube in later blogs so stay tuned.
For installing Jenkins on Ubuntu we need following:
1) A machine with Ubuntu 16.04 or higher.
2) A non root user with sudo privilege.
3) At-least 1GB of RAM.
Installation on Ubuntu:
Jenkin is based on JAVA and we can install it in different ways like using the package manager or by downloading the WAR file.
First step is to add the repository key:
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
We will get OK in the response of the above command.
Second step is to appennd this debian package repository to the server's source.list
echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
Third step is to update the system repository
sudo apt-get update
Fourth step is to install Jenkins
sudo apt-get install jenkins
Download the debian software package from here.
Check file and if execute permission is not there please give execute permission using following command
sudo chmod +x jenkins_2.124_all.deb
Install Jenkins using following command
sudo dpkg -i jenkins_2.124_all.deb
Start and check the status:
Now start Jenkins and verify the status
sudo systemctl start jenkins
sudo systemctl status jenkins
Now we can open Jenkins through browser by opening following URL:
For the first time Jenkins will prompt to unlock and will tell us to copy the password from following location:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
We can copy the password and paste it against Administrator password test box. After that it will ask to choose the plug-in option. We can pick the suggested plug-ins for now, it will install those plug-in and then will ask to create the first admin user. After creating the admin account it will show the message as 'Jenkins is ready !'
If you want to know the Jenkins and SonarQube installation process and configuration then refer to my previous blog:
Why SonarQube is important for IT projects ?
Configure Jenkins for Automated Code Deployment
SonarQube installation on Ubuntu
Configure SonarQube Scanner with Jenkins
Analyze your project with SonarQube
In this way we can install Jenkins on Ubuntu machine. Please feel free to comment in case you have any queries.
Author | Blogger | Tech Lead | Elastic Stack | Innovator |View Profile
Leave a comment
Mar 9, 2019, 8:20:38 AM | Anurag Srivastava
Feb 9, 2019, 6:34:22 PM | Anurag Srivastava
Jan 31, 2018, 6:11:29 AM | Anurag Srivastava
Apr 14, 2018, 1:18:05 PM | Anurag Srivastava
Feb 9, 2019, 12:06:18 PM | Anurag Srivastava
Oct 13, 2018, 8:49:59 PM | Anurag Srivastava
Jun 21, 2018, 4:58:11 AM | Anurag Srivastava
Jun 26, 2018, 4:50:18 PM | Anurag Srivastava
Jul 16, 2018, 5:00:02 PM | Anurag Srivastava
May 26, 2018, 6:42:02 PM | Anurag Srivastava
Jul 12, 2018, 7:40:51 PM | Anurag Srivastava
Aug 14, 2018, 4:47:56 PM | Anurag Srivastava