Challenge - 5 Problems
Build Steps Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this Jenkins pipeline step?
Consider this Jenkins pipeline snippet:
What will Jenkins print in the console log during the Build stage?
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building project...'
}
}
}
}What will Jenkins print in the console log during the Build stage?
Jenkins
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building project...'
}
}
}
}Attempts:
2 left
💡 Hint
The echo step prints the given message to the console log.
✗ Incorrect
The echo step in Jenkins pipeline prints the specified string to the console output during the build.
🔀 Workflow
intermediate2:00remaining
Order of execution in Jenkins pipeline stages
Given this Jenkins pipeline:
What is the correct order Jenkins executes these stages?
pipeline {
agent any
stages {
stage('Test') {
steps {
echo 'Testing...'
}
}
stage('Deploy') {
steps {
echo 'Deploying...'
}
}
}
}What is the correct order Jenkins executes these stages?
Attempts:
2 left
💡 Hint
Stages in Jenkins pipeline run sequentially by default.
✗ Incorrect
Jenkins executes stages in the order they are defined unless parallel is specified.
❓ Troubleshoot
advanced2:00remaining
Why does this Jenkins pipeline fail to execute the shell command?
Look at this Jenkins pipeline snippet:
When running on a Windows agent, what error is most likely to occur?
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'echo Building project'
}
}
}
}When running on a Windows agent, what error is most likely to occur?
Attempts:
2 left
💡 Hint
The 'sh' step runs shell commands, which may not be available on Windows agents.
✗ Incorrect
The 'sh' step requires a Unix shell environment. On Windows agents without such environment, it fails with 'sh: command not found'.
✅ Best Practice
advanced2:00remaining
Which Jenkins pipeline step ensures a build step runs only if the previous step succeeded?
In Jenkins declarative pipeline, which step or directive ensures that a build step runs only if the previous steps in the stage succeeded?
Attempts:
2 left
💡 Hint
By default, steps run one after another and stop if one fails.
✗ Incorrect
In declarative pipelines, steps inside a stage run sequentially and if one fails, the stage stops and subsequent steps do not run.
🧠 Conceptual
expert2:00remaining
What is the effect of the 'parallel' directive in Jenkins pipeline?
In Jenkins pipeline, what happens when you use the 'parallel' directive inside a stage?
Attempts:
2 left
💡 Hint
Parallel means multiple things happen simultaneously.
✗ Incorrect
The 'parallel' directive runs multiple branches concurrently, reducing total build time.