Skip to main content

Command Palette

Search for a command to run...

Day-22 [part-2]:๐Ÿ”ง Jenkins Unleashed: Streamline Your DevOps Workflow with Automation ๐Ÿš€

Published
โ€ข4 min read
Day-22 [part-2]:๐Ÿ”ง Jenkins Unleashed: Streamline Your DevOps Workflow with Automation ๐Ÿš€
A

"I'm a 3rd-year Computer Engineering student at Marwadi University with skills in C++, web development (MERN stack), and DevOps tools like Kubernetes. I contribute to open-source projects and share tech knowledge on GitHub and LinkedIn. I'm learning cloud technologies and app deployment. As an Internshala Student Partner, I help others find jobs and courses." now currently focusing on #90DaysOfDevops

what Jenkins is and why it is used ?

Jenkins is an open-source automation server that is widely used for continuous integration and continuous delivery (CI/CD). It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery. Jenkins supports a wide range of plugins to integrate with various tools and technologies, making it highly extensible and customizable. It is used to improve the efficiency and reliability of the software development process by automating repetitive tasks, ensuring code quality, and enabling faster delivery of software updates.

Reflect on how Jenkins integrates into the DevOps lifecycle and its benefits.

Jenkins integrates into the DevOps lifecycle by automating various stages of the software development process, including building, testing, and deploying applications. It acts as a central hub for continuous integration and continuous delivery (CI/CD) pipelines, enabling teams to implement DevOps practices effectively.

Benefits of using Jenkins in the DevOps lifecycle include:

  1. Automation: Jenkins automates repetitive tasks, reducing manual intervention and the risk of human error.

  2. Continuous Integration: It allows developers to frequently integrate code changes into a shared repository, ensuring that the codebase is always in a deployable state.

  3. Continuous Delivery: Jenkins facilitates the automated deployment of applications to various environments, enabling faster and more reliable releases.

  4. Extensibility: With a vast library of plugins, Jenkins can integrate with numerous tools and technologies, making it highly customizable to fit different workflows.

  5. Scalability: Jenkins can be scaled to handle large projects and distributed builds across multiple machines.

  6. Improved Collaboration: By providing a unified platform for CI/CD, Jenkins enhances collaboration among development, testing, and operations teams.

  7. Feedback and Monitoring: Jenkins provides real-time feedback on build and test results, helping teams quickly identify and address issues.

Overall, Jenkins streamlines the DevOps lifecycle, improving efficiency, reliability, and speed of software delivery.

What is the role of Jenkins in automating the build, test, and deployment processes.

  1. Build Automation:

    • Jenkins automatically compiles the source code into executable files. This process, known as building, is triggered whenever there are changes in the code repository.

    • It ensures that the code is always in a buildable state, catching errors early in the development cycle.

  2. Test Automation:

    • Jenkins runs automated tests on the newly built code to verify its functionality and quality. This includes unit tests, integration tests, and other types of automated tests.

    • By running tests automatically, Jenkins helps identify bugs and issues early, reducing the time and effort required for manual testing.

  3. Deployment Automation:

    • Jenkins automates the deployment of applications to various environments, such as development, staging, and production.

    • It ensures that the deployment process is consistent and repeatable, reducing the risk of human error and making it easier to roll out updates and new features.

Overall, Jenkins streamlines the entire software development lifecycle by automating repetitive tasks, improving code quality, and enabling faster and more reliable software delivery.

Task 2: Create a Freestyle Pipeline to Print "Hello World"

Create a freestyle pipeline in Jenkins that:

  • Prints "Hello World"

  • Prints the current date and time

  • Clones a GitHub repository and lists its contents

  • Configure the pipeline to run periodically (e.g., every hour).

Click on the new item

Give a item nam and select itme type as freestyle project

Go into build steps and click on Execute shell

echo "Hello world" #copy this command and paste in Execute shell and save it

Now it's time to build so click on Build now

You can see output in console output and congratulations you have successfully print Hello world

  • Prints the current date and time
echo "Current date and time is $(date):

  • Clones a GitHub repository and lists its contents
git clone #repo name
cd #repo name
ls -a

  • Configure the pipeline to run periodically (e.g., every hour).

pipeline {
    agent any
    triggers {
        cron('* * * * *') // This sets the pipeline to run every minute
    }
    stages {
        stage('Example') {
            steps {
                echo 'This pipeline runs every minute'
            }
        }
    }
}

Thankyou for reading !!!!!!

90DaysOfDevops

Part 24 of 49

So In This Series I am following 90 DaysOfDevops challenge , what i will learn in my devops journey i will share with you with my blogs ,You will get blog on tools which used by devops engineer , example :- Linux,ansible,terraform,docker,etc

Up next

Day-22 [part-1]: Mastering Jenkins: A Step-by-Step Guide to CI/CD Automation ๐Ÿ› ๏ธ

โ€ข What is Jenkins ? Jenkins is an open source continuous integration-continuous delivery and deployment (CI/CD) automation software DevOps tool written in the Java programming language. It is used to implement CI/CD workflows, called pipelines. Jen...

More from this blog

A

Anand Raval

118 posts

Hello I am Anand Raval , i contributed my work in robotics(arduino uno) , fronted web devloper,competitive programming, now currently focusing on #90DaysOfDevops