Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Final Pipelines

Final tasks always run after the primary stage, whether the primary stage succeeded or failed.

Ordering

Final tasks run in reverse order of addition. Think of them as a cleanup stack.

That behavior is intentional because it lets you pair setup and teardown naturally:

  • start an ssh-agent
  • later stop that same agent in a final task

Good use cases

  • cleanup
  • closing sessions
  • deleting temporary state
  • sending a final summary after work is complete