[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Comprehensive Build Doc-2-BASH Transform ‏



All,

A buddy of mine and I (he's cc'd) have been writing a transform against the community comprehensive build doc which is intended to auto-generate BASH install code.

Currently, it generates about ~75% of the raw code that is needed for an install, whether you want to install a Node, Broker, or an AIO.  It also has the logic for Fedora/RHEL, etc.  IT will not work out of the box.  It requires a lot of extra massaging, and cleanup.  The nice thing is that it takes 5k+ lines of HTML and generates 1K lines of BASH including comments (containing relational chapter sections) that can be salted and peppered to taste... 

As I said above, there are many areas of the code that will require restructuring, or complete removal.  This  has to do with the way that the HTML divs were set up, and because that there are sections of the doc that aren't strict procedure --> but instead are FYI's.  There's currently no way to hook on what is gospel, v.s. what isn't because of the non-standardized form start to finish.  As it stands, you might find it useful.  Please feel free to pull against it if you wanna improve it.  It was an attempt to use a single sed script (I know, yay!) by leveraging branching, looping, etc.  It's very straightforward and powerful IMO. 

Grab a copy here: https://raw.github.com/TheDudesAbide/useful-scripts/master/OpenSHIFTStuff/Origin-2.0/html2bash.sed

Then, run this command in the same directory which you grabbed the transform script to generate the installer:


  • sed -nf html2bash.sed <(curl -s http://openshift.github.io/documentation/oo_deployment_guide_comprehensive.html) > ./install.sh

You can then run the installer by passing a few arguments to it as such:

  • sh ./install.sh (domain.name) (Fedora|RHEL6) (Broker|Node|AIO) (Jenkins) (YourRouterIP)

If you wanna skip using the sed script, and see what I've cleaned up thus far you can grab the OSO 2.0 BASH installer here: 


I'm still debugging it.  It is not complete.  There's NO CHECKING, or functionlization at all.  It's a pure 1-for-1 ingest from the doc: although there has been substantial clean up and fixes in several places from what was auto-generated by the first pass with the transform script. 

I'm treating this as a fishing trip to round-up others that wanna help co-author it, otherwise I wouldn't dare share it until it was functional and polished.  I think that it could spawn some ideas for how we document the comprehensive guide moving forward as to auto generate any number of installers in the future.  We have discussed writing an XSLT transform for it --> which in return can become puppet, salt, ansible statements (fairly easily) using such a method.

Happy Friday,


:wq!


Michael McConachie


NOTE: The information included and/or attached in this electronic mail transmission may contain confidential or privileged information and is intended solely for the addressee(s). Any unauthorized disclosure, reproduction, distribution or the taking of action in reliance on the contents of the information are strictly prohibited. If you have received the message in error, please notify the sender by reply transmission and delete the message without copying, disclosing or forwarding.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]