Jenkins and CI/CD: Revolutionizing Your Development Pipeline
What is CI, CD, Plugin, and Jenkins?
What is Continuous Integration?
Continuous Integration: Continuous integration (CI) typically involves:
- Taking the code and packaging it.
- Running various tests (such as unit test and integration tests) to ensure the code works correctly before deploying it.
- Performing security checks to identify and address vulnerabilities early in the development process.
What is Continuous Delivery?
The code is not automatically deployed there is a button we have to go and deploy it manually. Continuous Delivery (CD) is a software development practice where code changes are automatically built, tested, and prepared for a production release. However, the actual deployment to production is not automatic; it typically requires manual intervention, such as clicking a button to approve and initiate the deployment. This ensures that the software is always in a deployable state, but allows for human oversight before the final release.
What is Continuous Deployment?
Code automatically deploys after the CI process. Once we build the code CI process will automatically deploy it. Continuous Deployment (CD) is an extension of continuous integration where the code changes are automatically built, tested, and deployed to production without manual intervention. The changes are automatically deployed to the production environment once the CI process verifies that the build passes all tests and checks. This allows for rapid and frequent updates to the software, ensuring that new features, bug fixes, and improvements are delivered to users as soon as they are ready.
What is Jenkins and Why Jenkins?
Jenkins is an open-source automation server for continuous integration and delivery (CI/CD). It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and delivery of software projects. Jenkins can be configured to run various tasks through a web interface or via scripts, supporting numerous plugins to integrate with other tools and services.
- open source.
- 1000+ plugins.
- Free
- Paid, Enterprise(pay a little bit of money_
- Support and Managed service.
Let us now run Jenkins on Ubuntu :
Step 1: Create an Ec2 instance using an Ubuntu image or you can also install Jenkins on a Virtual machine, containers, etc.
Step 2: Connect to the instance and install Jenkins using the following commands.
sudo su -
sudo apt update -y
sudo apt-get install openjdk-11-jdk
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]" \https://pkg.jenkins.io/debian-stable binary/ | sudo tee \/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
sudo systemctl start jenkins
sudo cat /var/lib/jenkins/secrets/initialAdminPassword # for password first time login
#to chnage the port use this command
sudo vim /lib/systemd/system/jenkins.service
Step 3: Connect to the Jenkins on the port 8080.
Let us now understand about Plugins.
What are Plugins?
Plugins in Jenkins allow us to connect to other services. For Example: Connecting Jenkins with Azure Plugin, AWS plugin, GithubPlugin etc.Plugins in Jenkins are extensions that enhance the functionality of the Jenkins automation server. They allow Jenkins to integrate with various tools, platforms, and services, enabling users to customize and extend Jenkins’ capabilities. Plugins can add new features, support different version control systems, build tools, deployment platforms, and more, making Jenkins highly adaptable to different continuous integration and continuous delivery (CI/CD) workflows.
Let us create a plugin :
Step 1: In Jenkins Dashboard click on manage Jenkins.
Step 2: Create Plugins install without restart or with restart.