bitops icon indicating copy to clipboard operation
bitops copied to clipboard

Output schema

Open mickmcgrath13 opened this issue 3 years ago • 0 comments

from @ConnorGraham

BitOps does a poor job passing properties from one executable to the next. This is currently possible by hardcoding the property as an option in bitops.schema.yaml:

  type: object
  properties:
    cli:
     ...
    options:
      type: object
      properties:
        fetch-kubeconfig:
          type: boolean
          export_env: FETCH_KUBECONFIG
          default: true

This is not scalable as it would require modifying bitops.schema.yaml for every new output value. The responsibility of defining outputs should be pushed to an ops repo in bitops.config.yml

Sample bitops.config.yaml

terraform:
    cli: {}
    options: {}
    outputs:
      - name: kubeconfig
        export_env: KUBECONFIG
      - name: my-favourite-color
        export_env: FAV_COLOR

The above config.yml would instruct bitops to look for kubeconfig and my-favourite-color in a terraform output command (e.g. terraform output kubeconfig) and set it to the requested ENV var.

mickmcgrath13 avatar Mar 09 '21 16:03 mickmcgrath13