0

Wanted to know if there is any flag/option for concourse tasks inside a single job so that all tasks gets executed regardless of any task failing.

Thanks!

1 Answers1

1

Totally. By default, tasks run sequentially. If you want them to run independently of the sequence place them in the in_parallel key, like in the following pipeline:

jobs:
  - name: parallel-tasks
    plan:
    - in_parallel:
      - task: failing-task
        config:
          platform: linux
          image_resource:
            type: docker-image
            source:
              repository: alpine
          run:
            path: /bin/sh
            args: [ "-c", "exit 1"]
      - task: passing-task
        config:
          platform: linux
          image_resource:
            type: docker-image
            source:
              repository: alpine
          run:
            path: /bin/sh
            args: [ "-c", "exit 0"]

Running it will produce the following output: parallel tasks

in_parallel works with tasks as well as resources (e.g. running get in parallel)

  • 1
    Thanks oozie! Exactly the thing I was looking for. Much appreciated :) – Aswin Ramanath Feb 23 '22 at 09:05
  • But what if you want them sequential still but run a task after a certain has failed? there's "ensure" but that's not a task .. For example you want to "put" some data to s3 after a certain task .. even on failure. – trainoasis Dec 09 '22 at 16:22