Challenge - 5 Problems
Artifact Archiver Master
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 snippet?
Consider this Jenkins pipeline step for archiving artifacts:
What does this step do when executed?
archiveArtifacts artifacts: '**/build/*.jar', fingerprint: true
What does this step do when executed?
Jenkins
archiveArtifacts artifacts: '**/build/*.jar', fingerprint: trueAttempts:
2 left
💡 Hint
Think about what 'archiveArtifacts' and 'fingerprint: true' mean in Jenkins.
✗ Incorrect
The 'archiveArtifacts' step saves matching files as build artifacts. The pattern '**/build/*.jar' matches any .jar files inside any 'build' folder recursively. 'fingerprint: true' records file fingerprints for traceability.
❓ Configuration
intermediate2:00remaining
Which Jenkinsfile snippet correctly archives all .log files from the 'logs' directory?
You want to archive all .log files located directly inside the 'logs' folder in your workspace. Which snippet achieves this?
Attempts:
2 left
💡 Hint
Remember how glob patterns match files in directories.
✗ Incorrect
The pattern 'logs/*.log' matches all .log files directly inside the 'logs' folder only. '**/logs/*.log' matches .log files inside any 'logs' folder recursively, which is broader than needed.
❓ Troubleshoot
advanced2:00remaining
Why does the archiveArtifacts step fail with 'No artifacts found'?
You have this Jenkins pipeline step:
But the build fails with 'No artifacts found' error. What is the most likely cause?
archiveArtifacts artifacts: 'target/*.war'
But the build fails with 'No artifacts found' error. What is the most likely cause?
Attempts:
2 left
💡 Hint
Check if the files exist at the time the step runs.
✗ Incorrect
The error usually means the specified files do not exist in the workspace when the archive step runs. This can happen if the build did not produce them or they are in a different location.
🔀 Workflow
advanced2:00remaining
In which stage should you place the archiveArtifacts step for best practice?
You have a Jenkins pipeline with stages: Build, Test, and Deploy. Where should you place the archiveArtifacts step to archive build outputs?
Attempts:
2 left
💡 Hint
Think about when build outputs are ready and stable.
✗ Incorrect
Archiving artifacts right after the Build stage ensures you save the build outputs before tests or deployment, preserving the exact files produced.
✅ Best Practice
expert2:00remaining
What is the main benefit of enabling fingerprinting when archiving artifacts in Jenkins?
You enable fingerprinting in the archiveArtifacts step like this:
What is the primary benefit of this fingerprinting?
archiveArtifacts artifacts: 'dist/*.zip', fingerprint: true
What is the primary benefit of this fingerprinting?
Attempts:
2 left
💡 Hint
Fingerprinting is about tracking, not compression or encryption.
✗ Incorrect
Fingerprinting records a unique hash of each artifact file, allowing Jenkins to track which builds produced or consumed the same files, aiding in auditing and debugging.