Skip to main content
In this lesson, you will learn how to integrate manual intervention into your CI/CD pipeline using the Jenkins input step within a Jenkinsfile. This functionality allows a manager or team lead to verify the application in a staging environment before the production deployment proceeds, ensuring an extra layer of validation. Below is a simple example of a Jenkins pipeline with two stages: Build and Deploy. In the Deploy stage, the pipeline pauses and prompts the user for approval. When the user selects the “Yes, proceed!” option, the pipeline resumes and executes the subsequent steps.
Consider the following Jenkinsfile:
When you run this pipeline, the console output will display progress through the various stages. Upon reaching the Deploy stage, you will see an input prompt similar to the following:
At this point, the user must either click “Yes, proceed!” or choose to abort the process. Once approval is granted, the console output logs the approving user’s information:
After approval, the pipeline continues executing the remaining stages.
Below is another comprehensive example where the Jenkinsfile consists of three stages: Setup, Test, and Deployment. In this scenario, the Deployment stage halts for manual confirmation before proceeding. Notice that the input step is embedded within the stage, ensuring that the pause happens immediately before the stage’s associated steps are executed.
After saving and pushing this Jenkinsfile to your Git repository, navigate to your Jenkins job. When viewing the console output, you will observe that the build completes the Setup and Test stages seamlessly. Once it reaches the Deployment stage, the pipeline pauses and prompts for manual confirmation. You have the option to hit “Yes” to continue or abort the process. Upon clicking “Yes,” the approval is logged with your username, and the deployment phase proceeds.
Integrating manual input into your Jenkins pipeline adds an important checkpoint to ensure critical stages only execute after proper verification. This practice is especially useful in environments where a review process is necessary before a production deployment.
By following this guide, you can confidently incorporate manual interventions into your CI/CD workflows, reinforcing higher standards of quality control during deployments.

Watch Video

Practice Lab