0
0
Jenkinsdevops~30 mins

Input step for manual approval in Jenkins - Mini Project: Build & Apply

Choose your learning style9 modes available
Jenkins Pipeline Manual Approval with Input Step
📖 Scenario: You are automating a software deployment process using Jenkins. Before deploying to production, you want a human to review and approve the deployment manually.
🎯 Goal: Create a Jenkins pipeline script that pauses for manual approval using the input step before continuing to the deployment stage.
📋 What You'll Learn
Create a Jenkins pipeline script with a stage named Approval
Use the input step to pause the pipeline and ask for manual approval
After approval, print a message indicating deployment will proceed
💡 Why This Matters
🌍 Real World
Manual approval steps are common in deployment pipelines to ensure safety before releasing to production.
💼 Career
DevOps engineers often implement manual gates in CI/CD pipelines to balance automation with human oversight.
Progress0 / 4 steps
1
Create a basic Jenkins pipeline skeleton
Write a Jenkins pipeline script with a pipeline block and an empty stages section.
Jenkins
Need a hint?

Start with the basic Jenkins pipeline structure including pipeline, agent any, and stages blocks.

2
Add an Approval stage with an input step
Inside the stages block, add a stage named Approval that uses the input step with the message 'Approve deployment?'.
Jenkins
Need a hint?

Use stage('Approval') and inside steps, add input message: 'Approve deployment?'.

3
Add a deployment stage that runs after approval
Add another stage named Deploy after the Approval stage. Inside steps, add a echo statement that prints 'Deployment started'.
Jenkins
Need a hint?

Add a new stage Deploy with a step that echoes 'Deployment started'.

4
Print confirmation after manual approval
Add a script block inside the Deploy stage's steps to print 'Deployment approved and started' using echo.
Jenkins
Need a hint?

Wrap the echo command inside a script block to print the confirmation message.