Guarantee Scripted Cleanup
Use try/catch/finally for failure state and unconditional cleanup.
A advanced Jenkins challenge worth 20 points. Solve it hands-on in a real Jenkins environment in your browser - no local setup, no fake shells.
The Challenge
Scenario: A Scripted Pipeline must report test failures correctly while always removing sensitive workspace data.
Requirements:
- Put Test and Complete inside
try - In
catch, setcurrentBuild.resulttoFAILUREand rethrow - In
finally, calldeleteDir() - Run a successful build and confirm cleanup executes