🗼What is Jenkins?
*Jenkins is an open-source automation server used for building, testing, and deploying software. It facilitates continuous integration and continuous delivery (CI/CD) by automating the repetitive tasks involved in the software development process.*deployment (CI/CD) automation software DevOps tool written in the Java programming language. It is used to implement CI/CD workflows, called pipelines.
Jenkins is a tool that is used for automation, and it is an open-source server that allows all the developers to build, test and deploy software. It works or runs on java as it is written in java. By using Jenkins we can make a continuous integration of projects(jobs) or end-to-endpoint automation.
🗼What is CI/CD?
CI/CD stands for Continuous Integration and Continuous Delivery/Continuous Deployment. It is a set of practices, often supported by automation tools, that aims to enhance the efficiency and reliability of software development and delivery.
🗼1.Continuous Integration (CI):
Objective: To integrate code changes from multiple contributors into a shared repository frequently, typically several times a day.
Process: Developers submit their code changes to a version control system (e.g., Git). Automated builds and tests are triggered whenever changes are committed.
Benefits:
Early detection of integration issues.
Faster identification and resolution of bugs.
Ensures that the codebase is always in a functional state.
🗼2 .Continuous Delivery (CD):***
Objective: To ensure that the software is always in a releasable state, and it can be deployed to production or any other environment at any time.
Process: After successful CI, the code is automatically deployed to a staging or pre-production environment. The deployment to production is usually a manual decision.
Benefits:
Allows for more frequent and reliable releases.
Reduces the time and effort required for manual deployment.
Provides the flexibility to release when business requirements dictate.
🗼3. Continuous Deployment (CD):
Objective: To automate the entire deployment process, including the release to production, without manual intervention.
Process: After successful CI, the code is automatically deployed to production without manual approval.
Benefits:
Enables rapid and automated delivery of new features and bug fixes.
Reduces the risk of human error in the deployment process.
🗼CI/CD tools?
CI/CD tools can help a team automate their development, deployment, and testing. Some tools specifically handle the integration (CI) side, some manage development and deployment (CD), while others specialize in continuous testing or related functions.
One of the best known open source tools for CI/CD is the automation server Jenkins. Jenkins is designed to handle anything from a simple CI server to a complete CD hub.
Task :
Create a freestyle pipeline to print "Hello World!!"
Step 1 : Install Jenkins on EC2 instance using command
sudo apt update
sudo apt install fontconfig openjdk-17-jre
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
Step 2: Allow port 8080 on the EC2 instance.
Step 3: Unlock Jenkin, complete the initial setup you will get an interface like this below
Step 4: login jenkins and will see the some tape.
Give your project a name, select "Freestyle project" as the job type and click on the "OK" button.
we will go to configuration page, you can specify the source code management, build triggers, build environment, and build steps.
Step 7: on the configuration page In the Build Steps section we have an option Execute Shell by which we can write some Shell commands.
Step 8: we want to print a hello world job you have to write a simple shell script with echo command.
Step 9 : Click on the Save button to create the project, now click on Build Now to run the project.
Step 10: Check the console output
I have Successfully Created a freestyle pipeline to print "Hello World!!
🗼Thanks for reading my blog, if you like this blog then comment and like my blog.