Day 22 : Getting Started with Jenkins
Table of contents
What is CI/CD?
A CI/CD pipeline (Continuous Integration/Continuous Deployment) is a set of development processes that engineers use to automate the build and release process of software products. Let’s break it down:
Continuous Integration (CI): This phase focuses on automatically integrating code changes from multiple developers into a single codebase. It ensures that code is consistently built, tested, and validated as part of the development workflow. By catching issues early, CI helps maintain code quality and reduces integration problems when merging changes.
Continuous Deployment (CD): After successful integration, the CD phase takes over. It involves automatically deploying the application to various environments (such as development, staging, and production) based on predefined rules. CD ensures that the latest code changes are available for testing and production use.
Pipeline Workflow:
Building: Compiling code, resolving dependencies, and creating artifacts.
Testing: Running unit tests, integration tests, and other quality checks.
Deployment: Deploying the application to target environments.
Monitoring: Monitoring the deployed application for issues.
Feedback Loop: Providing feedback to developers based on test results and monitoring data.
Benefits of CI/CD Pipelines:
Speed: Faster development cycles due to automation.
Quality: Consistent testing and validation improve code quality.
Reliability: Reduced manual errors and consistent deployment.
Agility: Enables rapid feature releases and bug fixes.
Containerized Environments and CI/CD:
Traditional CI/CD systems use virtual machines, but cloud-native development leverages containers.
Tekton is a project that allows building Kubernetes-style delivery pipelines, controlling the complete lifecycle of microservices without relying on central teams.
Red Hat OpenShift Pipelines builds on Tekton, providing a Kubernetes-native CI/CD solution with tight integration into OpenShift and Red Hat developer tools.
What is Jenkins?
Jenkins is a powerful open-source automation tool written in Java, primarily used for Continuous Integration/Continuous Delivery (CI/CD) in DevOps practices. It enables developers to automate the building, testing, and deployment of software projects efficiently. Jenkins operates on Java, making it versatile and platform-independent.
One of Jenkins' key features is its ability to create and manage pipelines, which are sequences of automated tasks that facilitate the CI/CD process. These pipelines streamline the development lifecycle by orchestrating various stages such as code compilation, testing, and deployment.
The strength of Jenkins lies in its extensive plugin ecosystem, which allows seamless integration with a wide range of tools and technologies commonly used in DevOps workflows. These plugins extend Jenkins' functionality to support diverse requirements, including version control systems like Git, build tools like Maven, cloud services like Amazon EC2, and many others.
In summary, Jenkins simplifies and accelerates the software development process by automating repetitive tasks, enabling faster feedback loops, and promoting collaboration among development teams through its robust CI/CD capabilities and extensive plugin support.
Jenkins one Step installation:
It seems you want to install Jenkins on your Ubuntu system. Here are the commands you provided:
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
These commands perform the following steps:
Downloads the Jenkins GPG key and saves it to
/usr/share/keyrings/jenkins-keyring.asc
.Adds the Jenkins repository to the system's package sources by echoing the repository information into a file named
jenkins.list
inside the/etc/apt/sources.list.d/
directory.Updates the package index to ensure it includes the latest available packages from the newly added repository.
Installs Jenkins using
apt-get install
.
Make sure to run these commands in your terminal with sudo privileges, as they require administrative access to the system. After executing these commands, Jenkins should be installed on your system, and you can start configuring it according to your requirements.