Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSC meta settings file override #545

Open
michaeltlombardi opened this issue Sep 11, 2024 · 0 comments
Open

DSC meta settings file override #545

michaeltlombardi opened this issue Sep 11, 2024 · 0 comments
Labels
Issue-Enhancement The issue is a feature or idea Needs Triage

Comments

@michaeltlombardi
Copy link
Collaborator

Summary of the new feature / enhancement

As a resource author, I want to quickly and conveniently switch between the settings DSC uses to make testing and development easier without having to update and redefine my settings repeatedly.

Related to and dependent on #282.

Proposed technical implementation details (optional)

DSC commands could support an optional --settings-file flag that uses an alternate meta configuration for that execution. The command(s) for defining the meta configuration could support an optional --path flag that creates/updates the settings data in an alternate location, using the default if not specified.

DSC could also respect the DSC_SETTINGS_FILE environment variable in addition to the command flag:

  • If neither the environment variable nor flag are specified for a command, use the default settings file path.
  • If the environment variable is defined and the flag isn't specified, use the settings file defined by the environment variable.
  • If the command flag is specified, use the settings file it specifies.
  • If the specified settings file from env or flag isn't found, error and abort with a specified exit code.
  • If the specified settings file isn't valid, error and abort with a specified exit code.

For example:

# Show settings in default file
dsc settings get

# Show settings in dev file
dsc settings get --path ~/dev.dsc.settings.yaml

# Use default settings file
$myConfig | dsc config set

# Use settings in dev file by flag
$myConfig | dsc config set --settings-file ~/dev.dsc.settings.yaml

# Use settings in dev file by env var, then override with ops file:
DSC_SETTINGS_FILE="~/dev.dsc.settings.yaml"
$myConfig | dsc config set
$myConfig | dsc config set --settings-file ~/ops.dsc.settings.yaml
@michaeltlombardi michaeltlombardi added Issue-Enhancement The issue is a feature or idea Needs Triage labels Sep 11, 2024
@michaeltlombardi michaeltlombardi changed the title DSC meta settings override DSC meta settings file override Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement The issue is a feature or idea Needs Triage
Projects
None yet
Development

No branches or pull requests

1 participant