Skip to content

Handle multiple configurations natively #3523

@lbergnehr

Description

@lbergnehr

Is your feature request related to a problem? Please describe.
When operating multiple environments (state stores and secrets stores), it's chore to switch between the different stores, having to manually edit the configuration file in some way.

Describe the solution you'd like
It would be nice if Porter provided some mechanism to easily switch between different configurations. You could have one configuration mapping to one environment and another mapping to another. You could even imagine having a configuration tree where base configuration could be inherited/overridden by more specific configuration.

So that I could do either (simple):

  • PORTER_CONFIG_HOME=~/porter/prod porter installation list
    or, more advanced:
  • porter config use prod && porter installation list
    or
  • porter installation list --configuration=prod.

Describe alternatives you've considered
The simplest solution would be to just provide a way for Porter to know where to look for its configuration. Right now, this is given by the PORTER_HOME variable, but changing this also means changing the mixins and other things already installed. It would be nice if the configuration could be set even finer-grained than the whole Porter home.

A more fully managed solution would be to have Porter manage the different configurations for you, possibly with a new sub-command.

Additional context
We've created wrapper scripts to work around this internally, but they require creating a shim for Porter and copying/linking files when changing "environment" which feels hacky and is error-prone, especially when trying to support different shells.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions