#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
Jenkins · Topic 11 of 15

Jenkins Pipeline: Concepts & Types

What is a Jenkins Pipeline?

A Jenkins Pipeline is a combination of plugins that support integrating and implementing continuous delivery pipelines. A pipeline is essentially a group of events interlinked in a sequence, written using Groovy syntax.

Three Types of Pipelines

  1. Freestyle pipeline — built through manual, GUI-driven options; considered the older approach.
  2. Scripted pipeline — Groovy-based, more flexible/low-level scripting style.
  3. Declarative pipeline — a newer, more structured and readable syntax; this is what most real projects use today.

Scripted Pipeline Syntax Example

node {
    stage("stage 1") {
        echo "hi"
    }
}

Declarative Pipeline Syntax Example

pipeline {
    agent any
    stages {
        stage("code") {
            steps {
                echo "hi"
            }
        }
    }
}

Declarative syntax is the one used across all the real pipeline examples in this course.

Anatomy of a Declarative Pipeline

Creating Your First Pipeline Job

  1. From the Dashboard: New Item → select "Pipeline" → OK.
  2. Under the Pipeline tab, write your Groovy script (indentation is applied automatically — a tab or 4 spaces).
  3. Save, then click Build. The GUI switches to a Stage View showing each stage's execution step by step.
  4. Click on a stage's Logs to see its console output.

Multi-Stage Example

pipeline {
    agent any
    stages {
        stage("code") {
            steps { echo "hello" }
        }
        stage("build") {
            steps { sh 'cal 10 2023' }
        }
        stage("deploy") {
            steps {
                sh '''
                touch file
                uptime
                uname
                '''
            }
        }
    }
}

Master Jenkins & DevOps with Uncodemy

Hands-on live training, real projects, and placement support — become job-ready in DevOps.

Enroll in DevOps Training →