Reusable Executors
complete
D
David Magalhães
As I was creating my first Orb, I think it is useful to reuse executors when defining a job. For example my Orb have one Elixir docker image and a Postgres docker image. But if the project uses FakeS3 for testing, it will need to add another docker image.The current solution is to define a new executor that have all the docker images necessary. In the CircleCI docs there is an example of override executors (https://circleci.com/docs/2.0/reusing-config/#overriding-keys-when-invoking-an-executor) but the functionality I want is to allow to use the orb executor plus some others.
CCI-I-895
K
Kyle Tryon
Hello all,Thank you for your request.Reusable executors are available here: https://circleci.com/docs/2.0/orb-concepts/#executors
D
David Magalhães
Maybe something along this lines:
orbs: elixir: coletiv/elixir@0.0.8executors: fakes3: docker: - image: circleci/fakes3:0.2.4jobs: build: executor: - elixir/default - fakes3 steps: - elixir/test
Not sure if this is the best structure, where the final objective is to have the fakes3 image available with Elixir and Postgres images.
executors: default: docker: - image: circleci/elixir:1.6.5 environment: MIX_ENV: test - image: circleci/postgres:10.4-alpine-postgis-ram - image: circleci/fakes3:0.2.4
N
Nathan Dintenfass
You can also pass an executor as a parameter -- can you show a sketch of what you'd want this to look like in config?