Challenge - 5 Problems
Build History and Logs Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Jenkins Build History Command Output
What is the output of the following Jenkins CLI command when run on a job with 3 completed builds?
Jenkins
java -jar jenkins-cli.jar -s http://localhost:8080/ list-builds my-jobAttempts:
2 left
💡 Hint
Jenkins CLI lists builds in descending order by default.
✗ Incorrect
The 'list-builds' command shows builds from newest to oldest. So build #3 is listed first.
❓ Troubleshoot
intermediate2:00remaining
Troubleshooting Missing Build Logs
A Jenkins user reports that build logs for a specific job are missing from the Jenkins UI. Which of the following is the most likely cause?
Attempts:
2 left
💡 Hint
Jenkins may delete old logs automatically when disk space is low.
✗ Incorrect
When disk space is low, Jenkins may clean up old build logs to free space, causing them to disappear from the UI.
❓ Configuration
advanced2:30remaining
Configuring Build Log Retention
Which configuration snippet in a Jenkins Pipeline script correctly sets the build log retention to keep logs for 10 days and a maximum of 5 builds?
Jenkins
pipeline {
agent any
options {
// Your configuration here
}
stages {
stage('Build') {
steps {
echo 'Building...'
}
}
}
}Attempts:
2 left
💡 Hint
Use the 'buildDiscarder' option with 'logRotator' in declarative pipelines.
✗ Incorrect
The 'buildDiscarder' with 'logRotator' is the correct syntax to configure log retention in Jenkins pipelines.
🔀 Workflow
advanced2:00remaining
Accessing Build Logs via REST API
Which HTTP request correctly retrieves the console log of build number 15 for a Jenkins job named 'deploy-app'?
Attempts:
2 left
💡 Hint
Jenkins exposes console logs at the 'consoleText' endpoint for a build.
✗ Incorrect
The console log for a specific build is accessed via the URL ending with '//consoleText'.
✅ Best Practice
expert3:00remaining
Best Practice for Managing Jenkins Build Logs in Large Environments
In a large Jenkins environment with many jobs and builds, what is the best practice to efficiently manage build history and logs?
Attempts:
2 left
💡 Hint
Automate log retention and use external storage for important data.
✗ Incorrect
Automatically discarding old logs and archiving important artifacts externally prevents disk space issues and keeps Jenkins responsive.