Skip to content

Override Config/Environment-based Config Files #584

@wbrawner

Description

@wbrawner

I saw #490 but I'm looking for more of a global override. The use case is as follows:

  1. I set up my site with CI to deploy to production for the master branch and staging for anything else
  2. In production, the site is the root content, but in staging, the site is in a subdirectory (i.e. example.com/ for production and dev.example.com/static/ for staging)
  3. For each environment, I'd like to at least modify the site.host config value, but there might be other config values that could be useful to change per-environment that I haven't thought of.

Possible implementations:

  1. Enable individual config overrides through a command line flag
jbake generate --config "site.host=https://example.com"
  1. Enable declaring an alternate config file
jbake generate --config-file production.properties

I think the second would probably be the easier of the two to implement, though the first would allow for less copy/paste for shared config between multiple environments.

If this is something you'd be interested in implementing, I'd be happy to contribute the code myself (I just wanted to get the conversation started before I went ahead and did anything)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions