๐ What is Jenkins?
Jenkins is an open-source automation server that helps automate the process of building, testing, and deploying software. It allows you to set up pipelines to automatically build your code, run tests, and deploy applications to various environments. Jenkins is highly extensible and can be integrated with a wide range of tools and plugins to support continuous integration and continuous delivery (CI/CD) workflows.
๐Let us do discuss the necessity of this tool before going ahead to the procedural part for installation:
Discussing the necessity of Jenkins before diving into the procedural part for installation is a great approach. Here are some key points on why Jenkins is necessary:
Automation: Jenkins automates repetitive tasks in the software development lifecycle, such as building, testing, and deploying code. This automation reduces manual effort, minimizes human errors, and speeds up the development process.
Continuous Integration (CI): Jenkins facilitates CI by automatically building and testing code whenever a new change is pushed to the repository. This helps in identifying and fixing bugs early in the development cycle, leading to higher software quality.
Continuous Deployment (CD): Jenkins supports CD by automating the deployment of code to various environments (e.g., staging, production) after it passes the CI process. This enables faster and more reliable software releases.
Scalability: Jenkins can be scaled horizontally to handle large CI/CD workloads by distributing build jobs across multiple nodes. This scalability ensures that Jenkins can support the growth of your development team and projects.
Integration with Tools: Jenkins integrates with a wide range of tools and technologies, such as version control systems, build tools, testing frameworks, and deployment tools. This integration allows for a seamless development workflow and enhances collaboration among team members.
Customization: Jenkins is highly customizable through its plugins and support for defining pipelines as code. This allows you to tailor Jenkins to fit your specific development and deployment requirements.
Overall, Jenkins is necessary for modern software development teams looking to improve efficiency, quality, and speed in their development and deployment processes.
๐Task 1: What you understood in Jenkins?
Jenkins is an automation server essential for modern software development. It enables continuous integration (CI) and deployment (CD), automating tasks like building, testing, and deploying code. Jenkins' key strength lies in its ability to create pipelines, defining the entire software delivery process as code. This automation helps teams catch bugs early, improve code quality, and accelerate software delivery. Jenkins is highly extensible, supporting integration with various tools and technologies through plugins. It's a versatile tool that empowers teams to build, test, and deploy software efficiently, making it a must-have for any development team striving for productivity and quality.
๐Task 2: Create a freestyle pipeline to print "Hello World!!
Step 1: If you want to create on AWS Ubuntu you need to install Java.
Step 2: Copy this all commands & paste it on AWS terminal as it is.
sudo apt update #Update Package List
sudo apt install -y openjdk-11-jdk #Install Java 11
java --version #Check Java Install or not
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 enable service
sudo systemctl start jenkins
sudo systemctl status jenkins
Step 3: Go to Security group, edit inbound rules add custom TCP
Select Port range 8080
& anywhere-IPv4
Save it.
Step 4: Access your Jenkins through your-public-IP: 8080
๐ You'll get Jenkins dashboard, install necessary packages.
Step 5: Set up a Freestyle project.
๐ Go to your Jenkins dashboard.
๐ Click on "New Item" to create a new job.
๐ Enter a name for your job (e.g., "HelloWorldPipeline") and select "Freestyle project".
๐ Click "OK" to create the job.
Step 6: Configure the Job
๐ In the job configuration page, go to the "Build" section.
๐ Click on "Add build step" and select "Execute shell".
๐ In the command box, type echo "Hello World!!"
.
Step 7: Save the Job Configuration.
Step 8: Run the Job.
๐ Click on "Build Now" to run the job.
๐ Jenkins will execute the pipeline and print "Hello World!!" in the console output.
Conclusion
Jenkins is a powerful automation tool that simplifies the software development process. It allows for the creation of pipelines that automate building, testing, and deploying code changes. Jenkins' flexibility and extensibility, through its wide range of plugins, make it a valuable tool for any development team looking to streamline their workflows and improve productivity. With Jenkins, teams can achieve continuous integration and deployment, leading to faster delivery of high-quality software.
I think this blog will be quite valuable, offering unique viewpoints and introducing new and engaging ideas. ๐
๐ Happy learning!