Skip to content

campaigns: allow environment variables to be passed through from the environment

Created by: LawnGnome

Right now, the env block in campaign specs allows environment variables to be defined within the Docker container running the steps, but does not provide an easy way to pass values through from the environment, which means that secrets would need to be encoded in the spec.

I see a couple of obvious options here; I'd argue we should do both:

  1. Add a templating function to pull in an arbitrary environment variable.

  2. Allow a shorthand definition like docker-compose allows when just passing values through; eg:

    env:
      - FOO
      - BAR

    To pass FOO and BAR directly into the container.

This also means that the spec isn't the sole source of truth, so we need to document accordingly, and potentially warn on missing environment variables.