Stages, Steps, and Post Blocks
Part of the Jenkins course
Your first pipeline was one sh line, and it worked. A real one is a checkout, a build, a test and a package, and the moment you have four of those in a row you hit a new problem: something failed, and the console log is nine hundred lines of shell output with no signposts in it. Worse, when the test step fails the pipeline stops dead, so the test report that would have told you which test failed never gets published.
This lesson fixes both. Stages give the pipeline visible structure, and post blocks give it a guaranteed ending that runs whether the middle succeeded or not. ...
Want to learn Jenkins Stages, Steps, and Post Blocks in a real environment?
Click below, get a fresh Linux box with Jenkins ready to go, and work through Stages, Steps, and Post Blocks hands-on with an AI tutor that knows your code.
Start this lessonStages, Steps, and Post BlocksWhat you'll learn
- Multiple stages
- Sh and echo
- ArchiveArtifacts
- Junit step
- Post always
- Post success and failure
Read this lesson in your language
All lessons in this course
11 lessons- 1What Is Jenkins20 min
- 2Your First Freestyle Job25 min
- 3Your First Declarative Pipeline30 min
- 4Stages, Steps, and Post Blocks30 min
- 5Artifacts and Test Results25 min
- 6Environment and Credentials30 min
- 7Parallel and Matrix Builds30 min
- 8Agents and Docker30 min
- 9Triggers and Schedules25 min
- 10Shared Libraries30 min
- 11Capstone: Pipeline as Code for a Node.js App45 min
