Skip to main content

Command Palette

Search for a command to run...

Day 26: Jenkins Declarative Pipeline

Updated
โ€ข2 min read
Y

I am Yashraj Singh Sisodiya, a 3rd Year CSE student at SVVV, born and raised in Shujalpur. Currently residing in Indore, I'm passionate about pursuing a career in DevOps engineering. My tech journey began with an internship at Infobyte, honing my skills as an Android Developer intern. Alongside my academic pursuits, I actively participate in co-curriculars, holding roles as Technical Lead at Abhyudaya and Cloud Lead at GDSC SVVV, while also serving as an MLSA of my college.

I have a keen interest in Cloud Computing, demonstrated through projects such as User management and Backup using shell scripting Linux, Dockerizing applications, CI/CD with Jenkins, and deploying a 3-tier application on AWS. Always eager to learn, I'm committed to expanding my knowledge and skills in the ever-evolving tech landscape.

As you embark on your DevOps and CI/CD journey, understanding Jenkins Declarative Pipeline Syntax is important. Here's a breakdown of some key terms and concepts:

Pipeline:

A pipeline is a sequence of interconnected steps or jobs that define the build, test, and deployment processes of your application.

Declarative:

Declarative is an advanced implementation of pipeline-as-code in Jenkins. It provides a simpler and more structured syntax compared to the older Scripted approach.

Scripted:

Scripted was the original implementation of pipeline-as-code in Jenkins, using Groovy. It's a more flexible but verbose approach compared to Declarative.

Why Use Pipeline:

  • Pipeline-as-Code: Defines the CD pipeline in a text file (Jenkinsfile) within the project's source control.

  • Versioning and Review: Allows the pipeline to be versioned and reviewed like any other code, ensuring consistency and traceability.

  • Automated Builds: Automatically creates a Pipeline build process for all branches and pull requests.

  • Code Review: Enables code review and iteration on the Pipeline alongside the rest of the source code.

Example Declarative Pipeline Syntax:

pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                // Perform build steps
            }
        }
        stage('Test') {
            steps {
                // Run tests
            }
        }
        stage('Deploy') {
            steps {
                // Deploy application
            }
        }
    }
}

Instructions:

  • Creating Jenkinsfile: Define your pipeline in a Jenkinsfile and commit it to your project's source control repository.

Benefits:

Enjoy automated builds for all branches and pull requests, along with the ability to review and iterate on the pipeline code alongside your application code.

By adopting Jenkins Declarative Pipeline, you establish a robust and scalable CI/CD process that integrates seamlessly with your development workflow.

Let your Pipeline guide your software delivery journey efficiently and effectively! ๐ŸŒ๐Ÿ› ๏ธ

More from this blog

Mastering DevOps: A Comprehensive Guide to Becoming a DevOps Engineer

39 posts

๐Ÿš€ Welcome to the world of DevOps with Yashraj! ๐ŸŒ

Hey tech enthusiasts! ๐Ÿ‘‹ I'm Yashraj, a dedicated third-year student pursuing Computer Science Engineering at SVVV Indore. Currently, I'm honing my ๐Ÿš€ Welcome to the world of DevOps with Yashraj! ๐ŸŒ

Hey tech enthusiasts! ๐Ÿ‘‹ I'm Yashraj, a dedicated third-year student pursuing Computer Science Engineering at SVVV Indore. Currently, I'm honing my skills in the realm of DevOps, fueled by my passion for technology and innovation.

๐Ÿ› ๏ธ My Tech Arsenal:

  • Docker
  • Linux
  • Kubernetes
  • Jenkins
  • AWS
  • Python
  • Java
  • Prometheus
  • Grafana
  • Ansible
  • Terraform

Join me in exploring the fascinating landscape of AWS DevOps technology. Let's embark on a journey of continuous learning and growth, embracing new challenges with enthusiasm and determination!

๐Ÿค Connect with me for:

  • Engaging discussions
  • Shared learning experiences
  • Collaborative learning opportunities

Follow my journey on Twitter and LinkedIn for daily insights and tech updates. Together, let's harness the power of DevOps to build, automate, and innovate our way to success! ๐Ÿš€ #DevOps #AWS #TechEnthusiast #InnovationJourney #90DaysOfDevOps