Continuous Integration is a major step in DevOps Life Cycle. It makes the Development, Testing and Deployment of applications easier and faster. There are a number of continuous integration tools like bamboo, Apache Gump Jenkins, BuildBot and Travis CI and among them, Jenkins is the most popular. In this blog, we will discuss how to Install Jenkins on Amazon Linux Ubuntu, Jenkins Architecture, and we will even create sample Jobs. Jenkins is a continuous integration tool that allows continuous development, test and deployment of newly created Code.
Install Jenkins on Ubuntu 20.04
Software Requirement
- Java
- Git
- Maven
- Jenkins
JAVA
sudo apt install openjdk-8-jdk
Git
sudo apt install git
Maven
sudo apt install maven
JENKINS
sudo wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt update sudo apt-get install jenkins
After Installation Jenkins will be running. In order to check Jenkins is running or not sudo systemctl status jenkins
Now you can navigate to IP/localhost:8080 to open Jenkins Dashboard
In order to get the Initial password you can run
cat /var/lib/jenkins/secrets/initialAdminPassword
After putting password select Install suggested plugins
and then Installation will begin.
After Installation Create Admin User
After this, your dashboard will launch.
Brief about Dashboard
On Left Sidebar you will see
1. New Item: It allows you to create a new project such as FreeStyle Project, Maven Project, a Build Pipeline etc.
2. Build History: This shows you the status of the build, the Time since the build is running and the status of the build.
3. Manage Jenkins: In this section, you can configure your system, configure global security, configure credentials, tool configuration and you can even download plugins.
How to Create and Run a Job
1. Select New Item and enter the name of the job and then select freestyle project and then OK
2. Enter Description and In Build section select Execute Shell
and enter shell command and then click apply and then save.
3. After Job is created go to Build Now
Options
4. In Console Log you will see the output that Job is successfully created.
Before Jenkins
Let’s see this scenario I think it’s something that maybe we all can relate to as developers. We all write code and we all submit that code into a code repository and we all keep working away writing our unit tests and hopefully, we’re running our unit tests but the problem is that the actual commits actually gets sent to the code repository aren’t consistent.
I as a developer may be based in India, I may have another developer that’s based in the Philippines and I may have another team leader based in the UK and another development team that’s based in North America so we’re all working at different times and we have different amounts of code going into the code repository.
There are issues with the integration and we’re kind of running into a situation that we’d like to call development hell where things just aren’t working out and there are just lots of delays being added into the project and the bugs just keep mounting up the bottom line is the project is delayed and in the past what we would have to do is we’d have to wait until the entire software code was built and tested before we could even begin checking for errors and this just really kind of increased the number of problems that we would have in our project. The actual process of delivering software was slow.
There was no way that we could actually iterate on our software and we just ended up with just a big headache, with teams pointing fingers at each other and blaming each other.
Jenkins Architecture
Server Architecture is broken into 2 sections
- Developer commits changes to the source code.
- Jenkins server checks the repository at regular intervals and pulls any newly available code.
Build server builds the code into an executable file. In case the build is failed, feedback is sent to the developer so that they can change the code and push again so that the built environment can run effectively.
The goal to go through this all process is to keep your code from the developer to the production server as quickly as possible. It has to be fully tested and have no errors.
If you like this Blog then Please Subscribe InfoHubBlog
For DevOps Lecture:
- Kubernetes: What is Kubernetes? , Setup Kubernetes Cluster in 15 minutes, Kubernetes Commands
- Docker: Docker for Beginners | Commands, Dockerfile Tutorial
Reference :
Leave a comment