Som Bhattacharyya
Som Bhattacharyya

Reputation: 4112

Circleci : How to run jobs serially in circle ci without depending on success only

I want to run two jobs sequentially in a circleci workflow . However I want the second one to run regardless of the outcome of the first one. Right now it looke to me like I only have two options either run it in parallel which I do not want or have them run serially but if the first one fails the rest do not execute.

Upvotes: 1

Views: 470

Answers (2)

Peter Fitzgibbons
Peter Fitzgibbons

Reputation: 81

As of Jan 2025, https://circleci.com/docs/configuration-reference/#requires

Requires allows status: The possible status values are: success, failed and canceled.

workflows:
  my-workflow:
    jobs:
      - notify-build-canceled:
          requires:
            - build: canceled
      - cleanup:
          requires:
            - deploy:
              - failed
              - canceled
    ```

Upvotes: 1

FelicianoTech
FelicianoTech

Reputation: 4017

You can't.

Why can't you run parallel? If there's something one job needs from the other, that's what sequential is for.

I'd either settle for the sequential as it is now, or depending on your specific circumstances (which I'm not aware of), you may be able to do 3 jobs. One base job that splits into two parallel.

Upvotes: 1

Related Questions