What is Jenkins?
Jenkins is an open-source DevOps tool that automates the CI/CD process. The term CI/CD refers to continuous integration, continuous deployment/delivery.
Continuous integration involves code building and testing, the code
As we all know any software goes through the basic steps of code, build, test and deploy before its production ready. Jenkins can be used to automate all these steps.
Jenkins works and runs on Java as it is written in Java. Any other tools that are needed to achieve the complete CI/CD process can be installed through plugins.
What is a job/pipeline?
A job/pipeline in Jenkins refers to a unit of work that Jenkins can execute, such as building a software project, running tests, deploying applications, or performing any other automated task.
Jenkins installation
Click the link (Jenkins installation link) to install Jenkins on your system. Be sure to install java before installing Jenkins.
Follow these steps to set up Jenkins on an EC2 ubuntu instance.
Jenkins runs on port 8080, so make sure to add a rule in the security group for inbound SSH traffic (You can refer to this link to learn how to add a rule in the security group)
You can access Jenkins browser by appending the port no to your IP address(you can find your IP address in your instance details) in my case it is
34.211.230.88:8080
The Jenkins server opens up to this page where you are supposed to unlock Jenkins.
To do this , you need to enter the security token from the path
/var/lib/jenkins/secrets/initialAdminPassword
.We can use the command below command to fetch the token
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
.Once the token is pasted, click "Continue" and the following page opens up.
Click on "Install suggested plugins"
Next, create the First Admin User by entering the required credentials
Now, we can start using Jenkins
What is a Freestyle project?
A freestyle project refers to a type of project that allows you to configure and customize various aspects of our build and deployment process using a flexible, user-friendly interface.
Here, we have the freedom to define our build steps, specify the source code management system (such as Git or Subversion), configure build triggers, set up post-build actions, and more.
Freestyle project to display Hello world
To display "Hello world"
Click on "New Item" or "Create a new job"
Enter the project name "display-hello-world" and select "Free style project" and click "OK"
Enter the project description, "This job displays the phrase "Hello world!"
Scroll down and select "Add build steps"
Enter the shell script to display hello world and "Save"
Press "Build now" button. The build starts and you can find in the bottom left corner that the build**(#1**) is successful.
To view the output, click on the #1 and then "Console output"
We can see that code is successfully built displaying the required output "Hello world!"