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

Support a config file #70

Open
alexharv074 opened this issue Aug 31, 2017 · 7 comments
Open

Support a config file #70

alexharv074 opened this issue Aug 31, 2017 · 7 comments

Comments

@alexharv074
Copy link

alexharv074 commented Aug 31, 2017

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.

@xorpaul
Copy link
Owner

xorpaul commented Aug 31, 2017

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"

@jovrum
Copy link
Contributor

jovrum commented Sep 1, 2017

Maybe another potential workaround would be using an overridable environment variable to specify the cachedir.

@xorpaul
Copy link
Owner

xorpaul commented Sep 1, 2017

There's already

g10k_cachedir=./tmp

, but that is only available in puppetfile mode.

I can also add that to the config mode.

@alexharv074
Copy link
Author

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?

@xorpaul
Copy link
Owner

xorpaul commented Sep 1, 2017

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 🤔

@xorpaul
Copy link
Owner

xorpaul commented Sep 1, 2017

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?

@alexharv074
Copy link
Author

alexharv074 commented Sep 1, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants