Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Git style configuration for cf-sketch #340

Open
nickanderson opened this issue Jul 2, 2013 · 11 comments
Open

Git style configuration for cf-sketch #340

nickanderson opened this issue Jul 2, 2013 · 11 comments

Comments

@nickanderson
Copy link
Member

It would really improve my work flow to have a git style config for cf-sketch. For example if I am working on two sperate infrastructures I'll have two sperate masterfiles clones. It would rock if I didn't have to specify the install target when working within the directory tree of each one. The ability to specify the install target relative to a config file found traversing up the directory tree would be awesome. It may be useful to have the configs merged as you go up the tree. (think about how git author, and email work)

My birthday is in September.... Hint hint

@tzz
Copy link
Contributor

tzz commented Jul 2, 2013

That sounds fairly easy to implement: start at pwd, then work up to a .git or .svn directory, then down to sketches or whatever the directory is named. It could be specified as VCS_ROOT/.../sketches for instance, where VCS_ROOT is a literal string and not a directory name. Let me know if this spec is what you had in mind.

@nickanderson
Copy link
Member Author

I was thinking a .cf-sketch directory and then the config for it would be inherited from the top
/etc/cf-sketch is inherited by ~/.cf-sketch which is inherited by the local .cf-sketch (just do an up tree directory traversal looking for it).

Thoughts?

@tzz
Copy link
Contributor

tzz commented Jul 2, 2013

I misunderstood and thought you wanted to autodetect just the installation directory. I think you're saying you want the cf-sketch configuration in a special file instead of in the command line. But does that include the API as well, or just cf-sketch the script? If the latter, what settings do you want to store in this config file?

@nickanderson
Copy link
Member Author

Yes, I am more talking about cf-sketch cli tool, not the API. The two primary config options that I think I might want to set per policy repository are install location and sources. If I am working with customer A I might want to point to their private sketch repo. Customer B might use only our community repo. Similar desires for setting Authors and other sketch metadata might come into play for a sketchify tool.

@tzz
Copy link
Contributor

tzz commented Jul 2, 2013

OK, so cf-sketch will look in pwd and then upwards for .cfsketchconfig or something. That file will have

repolist R1
repolist R2
installsource S

If you want more options, speak up. You can have the runfile name and standalone mode; the test/verbose/activated setting, --force, apiconfig...

@zzamboni
Copy link
Contributor

zzamboni commented Jul 2, 2013

Why not have the config file be a JSON file like one that cf-sketch already reads?

On Jul 2, 2013, at 12:41 PM, Ted Zlatanov [email protected] wrote:

OK, so cf-sketch will look in pwd and then upwards for .cfsketchconfig or something. That file will have

repolist R1
repolist R2
installsource S
If you want more options, speak up. You can have the runfile name and standalone mode; the test/verbose/activated setting, --force, apiconfig...


Reply to this email directly or view it on GitHub.

@nickanderson
Copy link
Member Author

I don't care if the config file is JSON, it might as well support any option that makes sense I just dont know how I would use the other options.

If the config file is JSON my next request will be tooling to help write it (think git config --global user.email )

Also I think inherited merging of the config as git does would be nice.
Look in /etc/.cf-sketch/config then merge with ~/.cf-sketch/config then merge with pwd up to next .cf-sketch/config each time the more specific config will overwrite any options found in the parent.

@tzz
Copy link
Contributor

tzz commented Jul 2, 2013

Sorry, I don't know what config file cf-sketch reads today. If you mean the apiconfig, that's a different configuration from what @nickanderson is requesting.

@zzamboni
Copy link
Contributor

zzamboni commented Jul 2, 2013

You are correct, I was confused. The previous version of cf-sketch used to read a config file, the code is still there in perl-lib/DesignCenter/Config.pm but is not being used anymore. Maybe it (or an improved version) could be reused.

On Jul 2, 2013, at 12:50 PM, Ted Zlatanov [email protected] wrote:

Sorry, I don't know what config file cf-sketch reads today. If you mean the apiconfig, that's a different configuration from what @nickanderson is requesting.


Reply to this email directly or view it on GitHub.

@tzz
Copy link
Contributor

tzz commented Jul 2, 2013

Cool. So it the format I proposed OK with @nickanderson? I think I could support that and a JSON format, autodetected, especially if there are only a few options.

@nickanderson
Copy link
Member Author

If you think that configuration format is sufficient for whatever kind of option someone might want to have if they deal with multiple CFEngine masterfiles that are completely unrelated from the same workstation then cool.

Sorry I am only currently able to imagine altering the sketch repo and the install target.

And at least for the install target I should be able to specify the path relative to the configfile or the config directory or whatever so that I can move different repositories around without having to reconfigure the install target.

tzz pushed a commit to tzz/design-center that referenced this issue Jun 1, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants