The input function pauses a pipeline and takes an explicit input/approval from the user before continuing.
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).
pipeline {
agent any
stages {
stage('Input function') {
steps {
sh 'echo "hi my name is sandeep"'
input {
message "are you sure ?"
ok "yes"
}
}
}
}
}
This is exactly how manual approval gates are implemented before a production deployment in real projects.
Hands-on live training, real projects, and placement support — become job-ready in DevOps.
Enroll in DevOps Training →