1. What Is Jenkins?
Jenkins is an open-source automation tool written in Java with plugins built for continuous integration. Jenkins is used to continuously building and testing software projects, making it easier for developers to integrate changes to the project and making it easier for users to obtain a fresh build. It also allows you to continuously deliver your software by integrating with many testing and deployment technologies.
Jenkins achieves Continuous Integration with the help of plugins. Plugins allow the integration of Various DevOps stages. If you want to integrate a particular tool, you need to install the plugins for that tool—for example Git, Maven 2 project, Amazon EC2, etc.
2. What is the CI/CD Pipeline?
Continuous integration and continuous deployment (CI/CD) pipeline is a series of steps that must be performed to deliver a new version of the software. CI/CD pipelines are a practice focused on improving software delivery throughout the software development life cycle via automation.
By automating CI/CD throughout the development, testing, production, and monitoring phases of the software development lifecycle, organizations can develop higher-quality code, faster. Although it’s possible to manually execute each of the steps of a CI/CD pipeline, the true value of CI/CD pipelines is realized through automation.
3. What Is Continuous Integration, Continuous Delivery and Continuous Deployment?
Continuous Integration is a process of integrating code changes from multiple developers in a single project many times. The software is tested immediately after a code commit. With each code commit, code is built and tested. If the test is passed, the build is tested for deployment. If the deployment is successful, the code is pushed to production.
Continuous Delivery prepares deployments for production, allowing development teams to deploy changes easily with the push of a button.
Continuous delivery produces artifacts deployable to production—the next step after continuous integration (CI). It allows the organization to wait before deploying each new release to evaluate the change.
Continuous Deployment involves deploying every push to production automatically. There is no human intervention, so the organization doesn’t hold up the pipeline for approval. The only difference between continuous delivery and continuous deployment is the “button” that employees must push to approve the promotion of a build to production.
The pipeline automatically and frequently pushes changes to production without waiting for a human to approve each deployment. The organization must have full trust in the CI/CD process to ensure new releases are of high quality and ready to be pushed to customers with no human intervention.
4. What issue was faced before Jenkins and How did it get solved with the help of Jenkins?
Jenkins Continuous Integration tool is a server-based application that requires a web server like Apache Tomcat to run on various platforms.
Previously, all Developers had completed their assigned coding tasks, they used to commit their code all at the same time. Later, the Build is tested and deployed. But With the help of Jenkins, The code is built and tested as soon as the Developer commits the code. Jenkins will build and test code many times during the day.
Before the code commit was built, the test cycle was very infrequent, and a single build was done after many days. After the build is successful, Jenkins will deploy the source into the test server and notify the deployment team. If the build fails, then Jenkins will notify the errors to the developer team.
Before, Since the code was built all at once, some developers would need to wait until other developers finished coding to check their build, but after Jenkins, The code is built immediately after any of the Developer's commits.
Code build and test processes were entirely manual, so there were a lot of chances for failure. After Jenkins, Automated builds and test processes save timing and reduce defects.
Before, the code is deployed once all the errors are fixed and tested. After, The code is deployed after every successful build and test.
The development Cycle was slow previously, but now the development cycle is fast. New features are more readily available to users. Increases profits.
5. Steps of Jenkins Installation
First of all, you should have Java 11 or 17.
For Jenkins installation, I suggest following the official documentation because it depends of your OS. https://www.jenkins.io/doc/book/installing/
6. Create a freestyle pipeline to print "Hello World!
Now let's try to create a job that will print Hello World. So how to do it?
Step 1: Click on New item [You can check it from the Dashboard image, Upper left side corner ]
This page will open and give any name to your project then click on FreeStyle project, and click on ok.
[The purpose of the freestyle project is to implement, develop, or run simple jobs like allowing you to specify the version control system from which you are required to extract code and build it and call tests if available. Freestyle projects are meant to do simple jobs for a project.]
Step 2:
Now this page will open where you have to configure your Jenkins job.
Give a general description of your project.
Step 3: Now scroll down to Build steps, you can select Execute shell option[as to print a hello world job you have to write a simple shell script with echo command].
Click on Save.
Step 4:
Now this page will open and click on the build now option and in the build history section click on the job number[i.e. 1, it is showing green which means your job was built successfully, but if it is showing red anytime which means there is an error ]
Step 5:
You can check your build from the console output option and it is successfully done.
So This is a simple job, later will do it in a more advanced way such as pipeline creation or how to configure a job with git, and docker with more such tools in an automated way.
Thanks For Reading...🙂