-
Notifications
You must be signed in to change notification settings - Fork 10
Analysis autogeneration and correct paths #87
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ab4a62e
Analysis of autgeneration
tuxmea 73727fa
Add OpenVox man and Doc workflow
tuxmea c942c9e
Workflow and output renaming
tuxmea cb82d87
Merge remote-tracking branch 'origin/master' into analysis_autogenera…
tuxmea 6de6c16
Update workflow references.
tuxmea ce0f426
Typo and add location for GIT url
tuxmea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,220 @@ | ||
| # Workflow for genrating reference | ||
|
|
||
| There are two generated refefences: | ||
|
tuxmea marked this conversation as resolved.
Outdated
|
||
|
|
||
| 1. from openfact | ||
| 1. from opnvox-agent | ||
|
tuxmea marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## OpenFact | ||
|
|
||
| From OpenFact we collect: | ||
|
|
||
| 1. CLI | ||
| 1. Core Facts | ||
|
|
||
| ## OpenVox Agent | ||
|
|
||
| From OpenVox agent we fetch | ||
|
|
||
| 1. bundled types and providers | ||
| 1. bundled functions | ||
|
|
||
| ## Changing content | ||
|
|
||
| ### OpenFact | ||
|
|
||
| #### CLI | ||
| CLI is rendered from man pages to markdown. | ||
| Content is in the openvox repositoriy. | ||
|
tuxmea marked this conversation as resolved.
Outdated
|
||
|
|
||
| Additional content is added via a preamble: `lib/puppet_references/facter/facter_cli_preamble.md` | ||
|
|
||
| #### Core Facts | ||
|
|
||
| Core Facts are rendered using a script, which is part of the openfact repo (`lib/docs/generate.rb`) | ||
|
|
||
| Additional contnet is added via a preamble file: `lib/puppet_references/facter/core_facts_preamble.md` | ||
|
tuxmea marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### OpenVox | ||
|
|
||
| OpenVox autogenerated documentation is rendered differently. | ||
|
|
||
| #### Man | ||
|
|
||
| Rendering takes place in `lib/puppet_references/puppet/man.rb` Line 78 ff | ||
|
|
||
| #### PuppetDoc | ||
|
|
||
| Completely rendered using `puppet doc` command from openvox repo documentation | ||
|
|
||
| #### Type | ||
|
|
||
| Type uses a preamble and a template: `lib/puppet_references/puppet/type_preamble.md` and `lib/puppet_references/puppet/type_template.erb` | ||
|
|
||
| #### TypeStrings | ||
|
|
||
| TypeStrings is inhertited from Type. | ||
|
tuxmea marked this conversation as resolved.
Outdated
|
||
|
|
||
| Content is rendered by running `puppet strings generate`. | ||
| Additional content is added in `lib/puppet_references/puppet/type_strings.rb` | ||
|
|
||
| #### Functions | ||
|
|
||
| Functions use a preamble and a template: `lib/puppet_references/puppet/functions_preamble.md` and `lib/puppet_references/puppet/functions_template.erb` | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. Rakefile | ||
|
|
||
| ### Rakefile | ||
|
|
||
| #### OpenFact | ||
|
|
||
| `PuppetReferences.build_facter_references(ENV.fetch('VERSION', nil))` | ||
|
|
||
| ##### build_facter_references | ||
|
|
||
| Building references | ||
|
|
||
| ```ruby | ||
| references = [ | ||
| PuppetReferences::Facter::CoreFacts, | ||
| PuppetReferences::Facter::FacterCli | ||
| ] | ||
| ``` | ||
|
|
||
| Repo action | ||
|
|
||
| ```ruby | ||
| repo = PuppetReferences::Repo.new('openfact', FACTER_DIR) | ||
| real_commit = repo.checkout(commit) | ||
| repo.update_bundle | ||
| ``` | ||
|
|
||
| 1. clone openfact repo into a local dir | ||
| 1. switches to provided version | ||
| 1. update all tags (fetch) | ||
| 1. runs bundle install | ||
|
|
||
|
|
||
| ```ruby | ||
| build_from_list_of_classes(references, real_commit) | ||
| ``` | ||
|
|
||
| ###### Core Facts | ||
|
|
||
| 1. executes ruby <openfact>/lib/docs/generate.rb | ||
| 1. adds header data + preamble + data | ||
| 1. writes core_facts.md file | ||
|
|
||
| ###### CLI | ||
|
|
||
| 1. runs bundle update in openfact | ||
| 1. runs bundle exec facter man | ||
| 1. uses PandDoc Ruby to convert man to markdown | ||
|
tuxmea marked this conversation as resolved.
Outdated
|
||
| 1. writs cli.md | ||
|
tuxmea marked this conversation as resolved.
Outdated
|
||
|
|
||
| #### OpenVox | ||
|
|
||
| `PuppetReferences.build_puppet_references(ENV.fetch('VERSION', nil))` | ||
|
|
||
| ##### build puppet reference | ||
|
|
||
| ```ruby | ||
| references = [ | ||
| PuppetReferences::Puppet::Man, | ||
| PuppetReferences::Puppet::PuppetDoc, | ||
| PuppetReferences::Puppet::Type, | ||
| PuppetReferences::Puppet::TypeStrings, | ||
| PuppetReferences::Puppet::Functions, | ||
| ] | ||
| ``` | ||
|
|
||
| 1. Reads config - can be removed | ||
| 1. Clones repo | ||
| 1. switch to version | ||
| 1. run bundle install | ||
| 1. build_from_list_of_classes (build_all) | ||
|
|
||
| ##### Man | ||
|
|
||
| 1. reads all files in openvox-agent/lib/puppet/application/*.rb | ||
| 1. deletes face_base, indirection_base, cert applications | ||
| 1.build index for all applications | ||
|
tuxmea marked this conversation as resolved.
Outdated
|
||
| 1. has data with categories: core, occasional and weird | ||
| 1. select from applications where data match | ||
| 1. 2 variables: header data and index_text | ||
| 1. within index_text, add the markdown files mentioned in data, first core, then occasional, then weird) | ||
| 1. write content to overview.md file | ||
|
|
||
| 1. for each command run build_manpage | ||
| 1. define a header | ||
| 1. read command from openvox-agent/man/man/command.8 | ||
| 1. calls PandDoc.ruby to convert from man to markdown, adding gsub methods on converted content | ||
| 1. write command file | ||
|
|
||
| ##### PuppetDoc | ||
|
|
||
| 1. calls build_reference | ||
| 1. calls `puppet doc` command | ||
| 1. calls clean_configuration_reference | ||
| 1. replaces fqdn with fixed string | ||
| 1. sets header data | ||
| 1. writes each reference.md file | ||
|
|
||
| ##### Type | ||
|
|
||
| typedoc script: <openvox repo>/lib/puppet_references/quarantine/get_typedocs.rb | ||
|
tuxmea marked this conversation as resolved.
Outdated
|
||
| typedoc template: <openvox-docs repo>/lib/puppet_references/puppet/type_template.erb | ||
| typedoc preamble: <openvox-docsrepo>lib/puppet_references/puppet/type_preamble.md | ||
|
tuxmea marked this conversation as resolved.
Outdated
|
||
|
|
||
| build_all: | ||
|
|
||
| get_type_json: execute typedoc script | ||
| save json file | ||
|
|
||
| build_index (type_data.keys.sort): | ||
|
|
||
| - header_data (title & canonical) | ||
| - skip component and wiki | ||
| - read all md files from type_data | ||
| - add header (autogenerated) see lib/puppet_references/util.rb | ||
| - write file (puppet/types/overview.md) | ||
|
|
||
| build_unified_page: | ||
|
|
||
| set header (title, canonical, toc_levels, toc) | ||
| sort attributes (namenvar first, ensure second) | ||
| write type individual files | ||
|
|
||
| build page: | ||
|
|
||
| set header (title, canonical) | ||
| sort attributes | ||
| write type file | ||
|
|
||
| ##### TypeStrings | ||
|
|
||
| output dir: puppet/types_strings | ||
|
|
||
| same as type, but different get_type_json | ||
|
|
||
| PuppetReferences::Puppet::Strings.new | ||
| read all filenames in lib/puppet/**/*.rb | ||
| run bundle exec puppet strings generate --format json --out string.json filenames.join(' ') | ||
| read strings.json file | ||
|
|
||
| iterate over content['resource_type'] | ||
| build new structure and content lib/puppet_references/puppet/type_strings.rb | ||
| THIS IS THE IMPORTANT file | ||
| This has the knowledge on the output and renders the new md | ||
|
|
||
| ##### Functions | ||
|
|
||
| template: functions_template.erb | ||
| preamble: functions_preamble.md | ||
|
|
||
| uses PuppetReferences::Puppet::Strings.new | ||
| sets header | ||
| render template, add header | ||
| write file | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
tuxmea marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.