Recall & Review
beginner
What is a stage in a Jenkins pipeline?
A stage is a major phase in a Jenkins pipeline that groups related steps together. It helps organize the pipeline into clear sections like Build, Test, and Deploy.
Click to reveal answer
beginner
What is a step in a Jenkins pipeline?
A step is a single task or command executed inside a stage. For example, running a shell command or checking out code.
Click to reveal answer
intermediate
How do stages help in visualizing a Jenkins pipeline?
Stages appear as separate blocks in the Jenkins UI, showing progress and results for each phase. This makes it easy to see where the pipeline is and if any stage failed.
Click to reveal answer
beginner
Write a simple Jenkins pipeline snippet with two stages: Build and Test.
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building...'
}
}
stage('Test') {
steps {
echo 'Testing...'
}
}
}
}
Click to reveal answer
intermediate
Can steps run outside of stages in a Jenkins pipeline?
No, in declarative pipelines, steps must be inside stages. This keeps the pipeline organized and easy to read.
Click to reveal answer
What does a stage represent in a Jenkins pipeline?
✗ Incorrect
A stage groups related steps into a phase like Build or Test.
Where do you define steps in a Jenkins declarative pipeline?
✗ Incorrect
Steps must be inside stages to keep the pipeline organized.
Which keyword starts a stage block in Jenkins pipeline syntax?
✗ Incorrect
The 'stage' keyword defines a stage block.
What is the purpose of stages in Jenkins pipeline visualization?
✗ Incorrect
Stages help visualize progress and results clearly.
Which of these is a valid step in a Jenkins pipeline?
✗ Incorrect
'echo' is a step that prints a message.
Explain the difference between stages and steps in a Jenkins pipeline.
Think of stages as chapters and steps as sentences in a book.
You got /4 concepts.
Describe how stages improve the clarity and management of a Jenkins pipeline.
Imagine stages as milestones on a project timeline.
You got /4 concepts.