concourseconcourse-pipelineconcourse-task

Concourse: Option to run all taks regardless of failure state


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!


Solution

  • 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)