#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 14 of 15

Input Function in Pipeline

What Does the Input Function Do?

The input function pauses a pipeline and takes an explicit input/approval from the user before continuing.

Real-Time Scenario

Continuous Integration (build + test) happens automatically without asking anyone. But when it comes to the deploy stage, we often want a human checkpoint — typically an approval manager reviews everything and clicks OK to approve the deployment.

To make this work properly, managers are usually given full build permissions via Role-Based Strategy (see the User Management topic).

Example

pipeline {
    agent any
    stages {
        stage('Input function') {
            steps {
                sh 'echo "hi my name is sandeep"'
                input {
                    message "are you sure ?"
                    ok "yes"
                }
            }
        }
    }
}

What Happens on Build

This is exactly how manual approval gates are implemented before a production deployment in real projects.

Master Jenkins & DevOps with Uncodemy

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

Enroll in DevOps Training →