Skip to content

Allow configuration file to be specified by an environment variable #543

@kevinjqiu

Description

@kevinjqiu

Similar to how kubectl loads configuration files, if KUBECONFIG environment variable is set, it will load that config file as opposed to $HOME/.kube/config.

We have a few CLI scripts built on top of invoke, and we'd like the ability to specify config files during runtime.

e.g., suppose our CLI needs to talk to different servers for different environments,

inv -f dev.yaml <command>
inv -f prd.yaml <command>

we'd like to have the ability to do:

export INV_CONFIG=$(pwd)/dev.yaml
inv <command>

@bitprophet if you think this is a worthy feature, I wouldn't mind contributing a PR.

Thanks for pyinvoke!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions