Concourse

On this page:

5.5.1.6 try step

try: step

Performs the given step, swallowing any failure.

This can be used when you want to perform some side-effect, but you don't really want the whole build to fail if it doesn't work.

Examples

Ignoring Non-Critical Behavior

When emitting logs somewhere for analyzing later, if the destination flakes out it may not really be critical, so we may want to just swallow the error:

plan:
- task: run-tests
  config: # ...
  on_success:
    try:
      put: test-logs
      params:
        from: run-tests/*.log
- task: do-something-else
  config: # ...