0% found this document useful (0 votes)
15 views

Jenkins Notes.pdf

Jenkins is an open-source automation server that facilitates continuous integration and continuous delivery (CI/CD) by automating software development tasks such as building, testing, and deploying. The document provides a step-by-step guide on installing Jenkins on AWS EC2, configuring jobs, and highlights its key features like extensibility and community support. It emphasizes the benefits of using Jenkins, including automation, consistency, speed, and quality in the development process.

Uploaded by

Divya satpute
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Jenkins Notes.pdf

Jenkins is an open-source automation server that facilitates continuous integration and continuous delivery (CI/CD) by automating software development tasks such as building, testing, and deploying. The document provides a step-by-step guide on installing Jenkins on AWS EC2, configuring jobs, and highlights its key features like extensibility and community support. It emphasizes the benefits of using Jenkins, including automation, consistency, speed, and quality in the development process.

Uploaded by

Divya satpute
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

JENKINS NOTES

Basic of Jenkins

DIVYA VASANT SATPUTE


Learnwithdivya.hashnode.dev
@Divya_Satpute_Notes Learnwithdivya.hashnode.dev

Introduction to Jenkins: What You Need


to Know

How to Use Jenkins: A Step-by-Step Guide


Hey there! Ready to dive into Jenkins? Whether you're new to
CI/CD or just need a refresher, this guide will help you get started
with Jenkins. Let's go!
Introduction to Jenkins
What is Jenkins?
• Jenkins is an open-source automation server.
• It helps automate the parts of software development related to
building, testing, and deploying, facilitating continuous
integration and continuous delivery (CI/CD).
• Jenkins is an open-source automation for CI-CD
• Jenkins tools developed using java
• Jenkins is part of Hudson Project
Initially it is called as Hudson then later it renamed to Jenkins
About CI CD
• CI and CD are two most frequently used terms in modern
development practices and DevOps practices
• CI stands for continuous Integration. It is fundamental DevOps
best practices where developers frequently merge code
changes to central repository where automated builds and
tests runs.
• CD means Continuous Delivery or Continuous Deployment.

@Divya_vasant_satpute
@Divya_Satpute_Notes Learnwithdivya.hashnode.dev

Introduction to Jenkins: What You Need


to Know

Jenkins is a self-contained, open-source automation server which can


be used to automate all sorts of tasks related to building, testing, and
deploying software.
Build and deployment Process
1. Take latest source code from Repository
2. Compile source code
3. Execute Unit tests (Junit)
4. Perform code Review
5. Package code as a war file
6. Deploy the war file into server
Note: All the above builds and deployment tasks can be automated
using Jenkins tool.
Key Features of Jenkins
• Extensible: Supports a wide range of plugins for integration
with various tools and services.
• Distributed Builds: Can distribute builds and tests across
multiple machines for faster execution.
• User-Friendly: Provides a simple and intuitive web-based
interface.
• Scalable: Easily scales up for large projects and teams.
Community Support: Boasts a large and active community, providing
a wealth of plugins, tutorials, and help.
Why Use Jenkins?

@Divya_vasant_satpute
@Divya_Satpute_Notes Learnwithdivya.hashnode.dev

Introduction to Jenkins: What You Need


to Know

• Automation: Reduces manual efforts by automating repetitive


tasks.
• Consistency: Ensures consistent build and deployment
processes.
• Speed: Accelerates development and deployment cycles.
• Quality: Enhances code quality by running automated tests.
• Integration: Seamlessly integrates with other tools and
services.

Prerequisite (Step 1)
• Jenkins installation on AWS EC2
• Create an EC2 instance with ubuntu Linux AMI
• Connect to your EC2 instance
• Update all packages by following command:
$sudo apt update -y

• Install java by following command:

$sudo apt install java-1.8.0-openjdk-devel


Step 2
Jenkins installation on AWS EC2 Using apt
Add Jenkins to your yum Repository using following command

@Divya_vasant_satpute
@Divya_Satpute_Notes Learnwithdivya.hashnode.dev

Introduction to Jenkins: What You Need


to Know

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

Import a key file from Jenkins -CI to enable installation from the
package
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian/jenkins.io-2023.key
echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]" \
https://pkg.jenkins.io/debian binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install Jenkins

Start and Enable Jenkins Service


$sudo systemctl start Jenkins
$sudo systemctl enable jenkins
$sudo systemctl status jenkins

Get the initial administration password


$sudo cat /var/lib/jenkins/secrets/initialAdminPassword

@Divya_vasant_satpute
@Divya_Satpute_Notes Learnwithdivya.hashnode.dev

Introduction to Jenkins: What You Need


to Know

step 3

Open your EC2 instance public IP (https://<public_IP>:8080/) along


with port 8080 in your favorite browser. And provide the
administration password obtained during the installation.
Note: Make sure you enable 8080 port in Security Group Inbound
Rules.
Provided password which we have copied to unlock Jenkins.
Select "Install Suggested Plugins" Card (It will install those plugins)
Creating Your First Job
1. New Item:
o Click on New Item in the Jenkins dashboard.
2. Name Your Job:
o Enter a name for your job and select Freestyle project.
3. Configure Your Job:
o Source Code Management: Link your job to a version
control system like Git.
o Build Triggers: Set when the job should run (e.g., after a
commit). Give Build Tigger Periodically
*****
o Build: Define the build steps, such as compiling code or
running tests.

@Divya_vasant_satpute
@Divya_Satpute_Notes Learnwithdivya.hashnode.dev

Introduction to Jenkins: What You Need


to Know

1. Save and Build:


o Save your job and click Build Now to run it.
Note: 5 * stars represent every minute Jenkins Job Should Execute
Configure Below Script as a Build Script
echo "Hello Guys, Divya Here"
touch divya.txt
echo "Hello Guys, Welcome to learnwithdivya.online" >> divya.txt
echo "Done ..!!"

Tips and Best Practices


• Backup Regularly: Ensure you have backups of your Jenkins
configuration and jobs.
• Use Pipelines: Pipelines provide a powerful way to define your
build process as code.
• Keep Jenkins Updated: Regular updates bring new features and
security improvements.
Conclusion

Jenkins is a powerful tool that can supercharge your development workflow. By


automating builds, tests, and deployments, it frees up your time and helps you focus
on what really matters – writing awesome code!

Happy building with Jenkins!

@Divya_vasant_satpute
@Divya_Satpute_Notes Learnwithdivya.hashnode.dev

Introduction to Jenkins: What You Need


to Know

@Divya_vasant_satpute

You might also like