DopplerHQ / cli

The official CLI for interacting with your Doppler secrets and configuration.
https://docs.doppler.com
Apache License 2.0
214 stars 43 forks source link

[FEATURE] Allow specifying repo config file from CLI #410

Open oev-chrisbennett opened 1 year ago

oev-chrisbennett commented 1 year ago

Is your feature request related to a problem? Please describe. I'd like to be able to specify a repo config file when running doppler setup so that I can easily switch between repo configs.

Describe the solution you'd like A flag specific to doppler setup so that I can use a chosen repo config file.

# setup as usual (doppler.yaml)
doppler setup --no-interactive

# setup with chosen config (doppler.alternative.yaml)
doppler setup --no-interactive -f doppler.alternative.yaml

Describe alternatives you've considered

Additional context

Thanks!

watsonian commented 1 year ago

@oev-chrisbennett Is the use case here a monorepo setup? We added support to help with those sorts of scenarios so you can do something like this:

setup:
  - project: cli
    config: dev
    path: .
  - project: example
    config: stg
    path: example/

Then if you run a single doppler setup --no-interactive, it'll scope the subdirectories to the correct project, so it'll automatically switch when you're in those subdirectories. Would this solve the issue you're having?

oev-chrisbennett commented 1 year ago

hey @watsonian yes - so my use case is using a monorepo setup (normal config in doppler.yaml), but I'd like to switch all configs at once using a separate config file (doppler.alternative.yaml), i.e.:

# doppler.yaml
setup:
  - project: cli
    config: dev
    path: .
  - project: example
    config: stg
    path: example/

# doppler.alternative.yaml
setup:
  - project: cli
    config: dev-second-config
    path: .
  - project: example
    config: stg-second-config
    path: example/

so I could run

doppler setup --no-interactive

to setup everything normally, then if I wanted to change to an alternative config I could run

doppler setup --no-interactive -f doppler.alternative.yaml

In this example it's only 2 projects but it would be a great help for a monorepo setup where I need to change 10+ configs at once.

watsonian commented 1 year ago

@oev-chrisbennett is the goal here swapping all services in the monorepo to a branch config for feature testing or something similar?

oev-chrisbennett commented 1 year ago

@watsonian yes - feature testing or changing backend providers where necessary.