cfengine / design-center

CFEngine community-contributed content
http://cfengine.com/
Other
80 stars 68 forks source link

Add status output when regenerating cfsketches.json It's useful to know which file it failed on. #421

Closed nickanderson closed 10 years ago

tzz commented 10 years ago

This tool is going to be removed, the cfsketches.json generation is in the DC API as of a while ago. Do cd tools/test; make regenerate_cfsketches

zzamboni commented 10 years ago

I think it would make sense to add this to cf-sketch. How about a new "admin" command to cf-sketch, which we could then use to group other maintenance or configuration subcommands. So you could then say:

cf-sketch admin regenerate_cfsketches

This should be fairly easy to add. Thoughts?

On Jan 15, 2014, at 4:56 PM, Ted Zlatanov notifications@github.com wrote:

This tool is going to be removed, the cfsketches.json generation is in the DC API as of a while ago. Do cd tools/test; make regenerate_cfsketches

— Reply to this email directly or view it on GitHub.

tzz commented 10 years ago

cf-sketch --make_cfsketches and cf-sketch make_readme

Already done, if not exactly as you specified :)

I don't know if we need an "admin" topic command, and passing arguments like you do worries me because you are taking over the primary arguments of cf-sketch. OTOH it's a very reasonable direction and would remove the need for --expert. So I'm 50-50.

nickanderson commented 10 years ago

cf-sketch --expert --make_readme gives me

Use of uninitialized value $options{"search"} in string eq at ./cf-sketch.pl line 183.
tzz commented 10 years ago

That seems like a bug. Did it exit or what???

nickanderson commented 10 years ago

It still printed out that it was generating readme. I tried the makefile and I found i needed some javascript beautifier. Running cf-sketch from the dc checkout, I am unable to find the latest sketch I am working on.

cmdln@ThinkPad-W520: ~/dev/cfengine/design-center/sketches [security/etc_nologin●●●] % grep nologin cfsketches.json 
security/nologin    {"api":{"etc_nologin":[{"name":"runenv","type":"environment"},{"name":"metadata","type":"metadata"},{"choice":["present","absent"],"default":"present","description":"The state of the /etc/nologin file (present|absent).","name":"state","type":"string"},{"default":"","description":"The content the /etc/nologin file should have.","name":"content","type":"string"}]},"interface":["main.cf"],"manifest":{"README.md":{"documentation":true},"main.cf":{"desc":"main file"}},"metadata":{"authors":["Nick Anderson <nick@cmdln.org>"],"depends":{"cfengine":{"version":"3.5.0"}},"description":"Enable /etc/nologin with specific content, or ensure its absent.","license":"MIT","name":"Security::nologin","tags":["enterprise_compatible","security","sketchify_generated","nologin"],"version":"1.0"},"namespace":"cfdc_security_nologin"}

cmdln@ThinkPad-W520: ~/dev/cfengine/design-center/sketches [security/etc_nologin●●●] % ../tools/cf-sketch/cf-sketch.pl
Welcome to cf-sketch version 3.5.1b1.
CFEngine AS, 2013.

Enter any command to cf-sketch, use 'help' for help, or 'quit' or '^D' to quit.

cf-sketch> search nologin

No sketches match your query.
nickanderson commented 10 years ago

I like the topic command style

cf-sketch admin make-metadata cf-sketch admin make-readme cf-sketch admin regen (do both readme and sketches)

But whatever, it doesnt matter that much to me. closing this because what we have works :)

nickanderson commented 10 years ago

Oh, BTW my issue was lack of README.md, cf-sketch was silently failing and not letting me know on the readme generation