0
0
Jenkinsdevops~20 mins

Archiving artifacts in Jenkins - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Artifact Archiver Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of this Jenkins pipeline snippet?
Consider this Jenkins pipeline step for archiving artifacts:
archiveArtifacts artifacts: '**/build/*.jar', fingerprint: true

What does this step do when executed?
Jenkins
archiveArtifacts artifacts: '**/build/*.jar', fingerprint: true
ADeletes all .jar files inside any 'build' folder in the workspace after the build.
BCopies .jar files from the workspace to a remote server without fingerprinting.
CArchives all .jar files inside any 'build' folder in the workspace and records fingerprints for tracking.
DArchives only the first .jar file found in the root workspace directory.
Attempts:
2 left
💡 Hint
Think about what 'archiveArtifacts' and 'fingerprint: true' mean in Jenkins.
Configuration
intermediate
2: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?
AarchiveArtifacts artifacts: '**/logs/*.log'
BarchiveArtifacts artifacts: '*.log'
CarchiveArtifacts artifacts: 'logs/**/*.log'
DarchiveArtifacts artifacts: 'logs/*.log'
Attempts:
2 left
💡 Hint
Remember how glob patterns match files in directories.
Troubleshoot
advanced
2:00remaining
Why does the archiveArtifacts step fail with 'No artifacts found'?
You have this Jenkins pipeline step:
archiveArtifacts artifacts: 'target/*.war'

But the build fails with 'No artifacts found' error. What is the most likely cause?
AThe Jenkins agent does not have permission to write to the workspace.
BThe 'target' directory does not exist or contains no .war files at archive time.
CThe 'archiveArtifacts' step requires a full absolute path, not a relative one.
DThe pipeline syntax is incorrect; 'artifacts' should be 'artifact'.
Attempts:
2 left
💡 Hint
Check if the files exist at the time the step runs.
🔀 Workflow
advanced
2: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?
AImmediately after the Build stage completes successfully.
BAt the start of the Test stage before tests run.
CAfter the Deploy stage to archive deployed files.
DBefore the Build stage to archive previous artifacts.
Attempts:
2 left
💡 Hint
Think about when build outputs are ready and stable.
Best Practice
expert
2:00remaining
What is the main benefit of enabling fingerprinting when archiving artifacts in Jenkins?
You enable fingerprinting in the archiveArtifacts step like this:
archiveArtifacts artifacts: 'dist/*.zip', fingerprint: true

What is the primary benefit of this fingerprinting?
AIt tracks which builds produced or used the same artifact files for traceability.
BIt compresses the artifacts to save storage space on the Jenkins server.
CIt automatically uploads artifacts to an external artifact repository.
DIt encrypts the artifacts to secure them from unauthorized access.
Attempts:
2 left
💡 Hint
Fingerprinting is about tracking, not compression or encryption.