g10k
g10k copied to clipboard
Support a config file
It would be great if this tool supported a config file at somewhere like ~/.g10k/config.yml
. My immediate use-case is that I want to move the cachedir
on my development laptop only, perhaps to /var/tmp/g10k
because /tmp
is cleaned every time the machine is booted. It looks like while I could specify an alternate cache dir on the command line, that's not ideal because I would need to either change it in the code which is also used in the CI system, or remember to type it each time I run g10k.
Sure, I'll look into it.
In the meantime you could use an alias on your dev laptop that uses a different cachedir
Something like:
alias g10k="g10k -cachedir /tmp/foobar"
Maybe another potential workaround would be using an overridable environment variable to specify the cachedir
.
There's already
g10k_cachedir=./tmp
, but that is only available in puppetfile mode.
I can also add that to the config mode.
So, I just run:
export g10k_cachedir=/var/tmp
And that will be my cachedir when I later run:
g10k -puppetfile
?
If so, that's perfect.
Maybe mention this awesomeness in the README?
Yep, that should do what you want, if you're only using the puppetfile mode.
I'm also not sure why this feature hasn't made it to the README :thinking:
I added a hint to the README.
The environment variable g10k_cachedir
can now also override the :cachedir
setting from the g10k YAML config and also takes precedence over the -cachedir
CLI parameter.
https://github.com/xorpaul/g10k/releases/tag/v0.3.12
Can you think of another reason a special config file would be helpful or can I close this issue?
I suppose if there is just one parameter to set, environment variables are fine, whereas if you had to set a few of these parameters, then a config file probably would make sense. Right now, an environment variable is perfect for me.