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.
You may like to read
Leave a comment
Sep 23, 2020, 2:38:00 PM | Anurag Srivastava
Sep 6, 2020, 5:20:33 PM | Anurag Srivastava
Jan 16, 2020, 11:43:29 AM | Anurag Srivastava
Jan 14, 2020, 10:22:34 AM | Anurag Srivastava
Jan 7, 2020, 7:15:34 PM | Anurag Srivastava
Jan 6, 2020, 7:30:13 PM | Anurag Srivastava
Jun 21, 2018, 4:58:11 AM | Anurag Srivastava
Jul 16, 2018, 5:00:02 PM | Anurag Srivastava
Jun 13, 2018, 3:44:01 PM | Anurag Srivastava
Jun 26, 2018, 4:50:18 PM | Anurag Srivastava
Mar 9, 2019, 8:20:38 AM | Anurag Srivastava
May 12, 2018, 4:47:07 PM | Anurag Srivastava