'How do I modularize the order of execution and/or dependency relationships between jobs in a CircleCI orb?
Our CircleCI orb defines two jobs - A and B.
Our customers use, and are expected to use the jobs in a specific way.
i.e., the customers are expected to define a job C, and invoke A and B such that A runs before C and B runs after C.
Currently, our customers enforce that using the 'require' key.
Is there a way to:
- abstract this detail (the order of job exec) away from our customers?
- ideally, require that the jobs can only be run in that exact order.
This is an actual example of a workflow our customer is using.
customers_workflow:
jobs:
- our-orb/a:
filters:
branches:
only: master
- c:
requires: [our-orb/a]
filters:
branches:
only: master
- our-orb/b:
requires: [c]
filters:
branches:
only: master
Solution 1:[1]
The potential only solution I've come up with so far is requiring c to be a shell script "c.sh" instead of a CircleCI job and combining jobs a and b into one job ab, which runs the commands in a, the shell script c.sh from the invoking repo and b consecutively.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Arpan Arpan |
