giblish 0.8.2 → 1.0.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/unit_tests.yml +30 -0
  3. data/.gitignore +7 -3
  4. data/.ruby-version +1 -1
  5. data/Changelog.adoc +61 -0
  6. data/README.adoc +267 -0
  7. data/docs/concepts/text_search.adoc +213 -0
  8. data/docs/concepts/text_search_im/cgi-search_request.puml +35 -0
  9. data/docs/concepts/text_search_im/cgi-search_request.svg +397 -0
  10. data/docs/concepts/text_search_im/search_request.puml +40 -0
  11. data/docs/concepts/text_search_im/search_request.svg +408 -0
  12. data/docs/howtos/trigger_generation.adoc +180 -0
  13. data/docs/{setup_server_assets → howtos/trigger_generation_im}/Render Documents.png +0 -0
  14. data/docs/{setup_server_assets → howtos/trigger_generation_im}/View Documents.png +0 -0
  15. data/docs/{setup_server_assets → howtos/trigger_generation_im}/deploy_with_hooks.graphml +0 -0
  16. data/docs/{setup_server_assets → howtos/trigger_generation_im}/deploy_with_hooks.svg +0 -0
  17. data/docs/{setup_server_assets → howtos/trigger_generation_im}/deploy_with_jenkins.graphml +0 -0
  18. data/docs/{setup_server_assets → howtos/trigger_generation_im}/deploy_with_jenkins.svg +0 -0
  19. data/docs/howtos/trigger_generation_im/docgen_github.puml +51 -0
  20. data/docs/{setup_server_assets → howtos/trigger_generation_im}/giblish_deployment.graphml +0 -0
  21. data/docs/howtos/trigger_generation_im/post-receive-example.sh +50 -0
  22. data/docs/reference/box_flow_spec.adoc +22 -0
  23. data/docs/reference/search_spec.adoc +185 -0
  24. data/giblish.gemspec +47 -29
  25. data/lib/giblish/adocsrc_providers.rb +23 -0
  26. data/lib/giblish/application.rb +214 -41
  27. data/lib/giblish/cmdline.rb +273 -259
  28. data/lib/giblish/config_utils.rb +41 -0
  29. data/lib/giblish/configurator.rb +163 -0
  30. data/lib/giblish/conversion_info.rb +120 -0
  31. data/lib/giblish/docattr_providers.rb +125 -0
  32. data/lib/giblish/docid/docid.rb +181 -0
  33. data/lib/giblish/github_trigger/webhook_manager.rb +64 -0
  34. data/lib/giblish/gitrepos/checkoutmanager.rb +124 -0
  35. data/lib/giblish/{gititf.rb → gitrepos/gititf.rb} +30 -4
  36. data/lib/giblish/gitrepos/gitsummary.erb +61 -0
  37. data/lib/giblish/gitrepos/gitsummaryprovider.rb +78 -0
  38. data/lib/giblish/gitrepos/history_pb.rb +41 -0
  39. data/lib/giblish/indexbuilders/d3treegraph.rb +88 -0
  40. data/lib/giblish/indexbuilders/depgraphbuilder.rb +109 -0
  41. data/lib/giblish/indexbuilders/dotdigraphadoc.rb +174 -0
  42. data/lib/giblish/indexbuilders/standard_index.erb +10 -0
  43. data/lib/giblish/indexbuilders/subtree_indices.rb +132 -0
  44. data/lib/giblish/indexbuilders/templates/circles.html.erb +111 -0
  45. data/lib/giblish/indexbuilders/templates/flame.html.erb +61 -0
  46. data/lib/giblish/indexbuilders/templates/tree.html.erb +366 -0
  47. data/lib/giblish/indexbuilders/templates/treemap.html.erb +127 -0
  48. data/lib/giblish/indexbuilders/verbatimtree.rb +94 -0
  49. data/lib/giblish/pathtree.rb +473 -74
  50. data/lib/giblish/resourcepaths.rb +150 -0
  51. data/lib/giblish/search/expand_adoc.rb +55 -0
  52. data/lib/giblish/search/headingindexer.rb +312 -0
  53. data/lib/giblish/search/request_manager.rb +110 -0
  54. data/lib/giblish/search/searchquery.rb +68 -0
  55. data/lib/giblish/search/textsearcher.rb +349 -0
  56. data/lib/giblish/subtreeinfobuilder.rb +77 -0
  57. data/lib/giblish/treeconverter.rb +272 -0
  58. data/lib/giblish/utils.rb +142 -294
  59. data/lib/giblish/version.rb +1 -1
  60. data/lib/giblish.rb +10 -7
  61. data/scripts/hooks/post-receive.example +66 -0
  62. data/{docgen/scripts/githook_examples → scripts/hooks}/post-update.example +0 -0
  63. data/{docgen → scripts}/resources/css/adoc-colony.css +0 -0
  64. data/scripts/resources/css/giblish-serif.css +419 -0
  65. data/scripts/resources/css/giblish.css +1979 -419
  66. data/{docgen → scripts}/resources/fonts/Ubuntu-B.ttf +0 -0
  67. data/{docgen → scripts}/resources/fonts/Ubuntu-BI.ttf +0 -0
  68. data/{docgen → scripts}/resources/fonts/Ubuntu-R.ttf +0 -0
  69. data/{docgen → scripts}/resources/fonts/Ubuntu-RI.ttf +0 -0
  70. data/{docgen → scripts}/resources/fonts/mplus1p-regular-fallback.ttf +0 -0
  71. data/{docgen → scripts}/resources/images/giblish_logo.png +0 -0
  72. data/{docgen → scripts}/resources/images/giblish_logo.svg +0 -0
  73. data/{docgen → scripts}/resources/themes/giblish.yml +0 -0
  74. data/scripts/wserv_development.rb +32 -0
  75. data/web_apps/cgi_search/gibsearch.rb +43 -0
  76. data/web_apps/gh_webhook_trigger/config.ru +2 -0
  77. data/web_apps/gh_webhook_trigger/gh_webhook_trigger.rb +73 -0
  78. data/web_apps/gh_webhook_trigger/public/dummy.txt +3 -0
  79. data/web_apps/sinatra_search/config.ru +2 -0
  80. data/web_apps/sinatra_search/public/dummy.txt +3 -0
  81. data/web_apps/sinatra_search/sinatra_search.rb +34 -0
  82. data/web_apps/sinatra_search/tmp/restart.txt +0 -0
  83. metadata +168 -73
  84. data/.rubocop.yml +0 -7
  85. data/.travis.yml +0 -3
  86. data/Changelog +0 -16
  87. data/Gemfile +0 -4
  88. data/README.adoc +0 -1
  89. data/Rakefile +0 -41
  90. data/bin/console +0 -14
  91. data/bin/setup +0 -8
  92. data/data/testdocs/malformed/no_header.adoc +0 -5
  93. data/data/testdocs/toplevel.adoc +0 -19
  94. data/data/testdocs/wellformed/adorned_purpose.adoc +0 -17
  95. data/data/testdocs/wellformed/docidtest/docid_1.adoc +0 -24
  96. data/data/testdocs/wellformed/docidtest/docid_2.adoc +0 -8
  97. data/data/testdocs/wellformed/simple.adoc +0 -14
  98. data/data/testdocs/wellformed/source_highlighting/highlight_source.adoc +0 -38
  99. data/docgen/resources/css/giblish.css +0 -1979
  100. data/docgen/scripts/Jenkinsfile +0 -18
  101. data/docgen/scripts/gen_adoc_org.sh +0 -58
  102. data/docs/README.adoc +0 -387
  103. data/docs/setup_server.adoc +0 -202
  104. data/lib/giblish/buildgraph.rb +0 -216
  105. data/lib/giblish/buildindex.rb +0 -459
  106. data/lib/giblish/core.rb +0 -451
  107. data/lib/giblish/docconverter.rb +0 -308
  108. data/lib/giblish/docid.rb +0 -180
  109. data/lib/giblish/docinfo.rb +0 -75
  110. data/lib/giblish/indexheadings.rb +0 -251
  111. data/lib/giblish-search.cgi +0 -459
  112. data/scripts/hooks/post-receive +0 -57
  113. data/scripts/publish_html.sh +0 -99
@@ -0,0 +1,408 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="733.3333px" preserveAspectRatio="none" style="width:823px;height:733px;background:#00000000;" version="1.1" viewBox="0 0 823 733" width="823.9583px" zoomAndPan="magnify"><defs/><g><rect height="45.0846" rx="4.1667" ry="4.1667" style="stroke:#BABDBF;stroke-width:1.0416666666666667;fill:none;" width="519.7917" x="165.1042" y="14.5833"/><text fill="#2FA4E7" font-family="Verdana" font-size="20.8333" lengthAdjust="spacing" textLength="492.7083" x="178.6458" y="44.338">Using a Passenger web-app for search requests</text><rect fill="#EEEEEE" height="649.2188" rx="4.1667" ry="4.1667" style="stroke:#868E96;stroke-width:1.0416666666666667;" width="695.8333" x="112.5" y="71.1263"/><text fill="#343A40" font-family="Verdana" font-size="12.5" font-weight="bold" lengthAdjust="spacing" textLength="187.5" x="366.6667" y="87.9374">Document-hosting Server</text><line style="stroke:#BABDBF;stroke-width:2.0833333333333335;stroke-dasharray:5.0,5.0;" x1="34.375" x2="34.375" y1="173.1445" y2="726.5951"/><line style="stroke:#BABDBF;stroke-width:2.0833333333333335;stroke-dasharray:5.0,5.0;" x1="207.2917" x2="207.2917" y1="173.1445" y2="726.5951"/><line style="stroke:#BABDBF;stroke-width:2.0833333333333335;stroke-dasharray:5.0,5.0;" x1="397.9167" x2="397.9167" y1="173.1445" y2="726.5951"/><line style="stroke:#BABDBF;stroke-width:2.0833333333333335;stroke-dasharray:5.0,5.0;" x1="594.7917" x2="594.7917" y1="173.1445" y2="726.5951"/><line style="stroke:#BABDBF;stroke-width:2.0833333333333335;stroke-dasharray:5.0,5.0;" x1="753.125" x2="753.125" y1="173.1445" y2="726.5951"/><text fill="#2FA4E7" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="42.7083" x="10.4167" y="164.9882">Viewer</text><ellipse cx="34.8958" cy="92.9688" rx="8.3333" ry="8.3333" style="stroke:#2FA4E7;stroke-width:2.0833333333333335;fill:none;"/><path d="M34.8958,101.3021 L34.8958,129.4271 M21.3542,109.6354 L48.4375,109.6354 M34.8958,129.4271 L21.3542,145.0521 M34.8958,129.4271 L48.4375,145.0521 " fill="none" style="stroke:#2FA4E7;stroke-width:2.0833333333333335;"/><rect height="39.5508" rx="4.1667" ry="4.1667" style="stroke:#2FA4E7;stroke-width:1.5625;fill:none;" width="98.9583" x="158.3333" y="132.5521"/><text fill="#2FA4E7" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="73.9583" x="170.8333" y="156.6549">Web Server</text><rect height="39.5508" rx="4.1667" ry="4.1667" style="stroke:#2FA4E7;stroke-width:1.5625;fill:none;" width="94.7917" x="351.0417" y="132.5521"/><text fill="#2FA4E7" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="69.7917" x="363.5417" y="156.6549">Passenger</text><rect height="54.1016" rx="4.1667" ry="4.1667" style="stroke:#2FA4E7;stroke-width:1.5625;fill:none;" width="111.4583" x="539.5833" y="118.0013"/><text fill="#2FA4E7" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="86.4583" x="552.0833" y="142.1041">Search script</text><text fill="#2FA4E7" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="67.7083" x="561.4583" y="156.6549">(Web app)</text><text fill="#2FA4E7" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="84.375" x="708.3333" y="164.9882">Search index</text><path d="M734.8958,110.6771 C734.8958,100.2604 753.6458,100.2604 753.6458,100.2604 C753.6458,100.2604 772.3958,100.2604 772.3958,110.6771 L772.3958,137.7604 C772.3958,148.1771 753.6458,148.1771 753.6458,148.1771 C753.6458,148.1771 734.8958,148.1771 734.8958,137.7604 L734.8958,110.6771 " style="stroke:#2FA4E7;stroke-width:1.5625;fill:none;"/><path d="M734.8958,110.6771 C734.8958,121.0938 753.6458,121.0938 753.6458,121.0938 C753.6458,121.0938 772.3958,121.0938 772.3958,110.6771 " fill="none" style="stroke:#2FA4E7;stroke-width:1.5625;"/><path d="M493.75,192.9362 L493.75,277.3112 A4.1667,4.1667 0 0 0 497.9167,281.4779 L692.7083,281.4779 A4.1667,4.1667 0 0 0 696.875,277.3112 L696.875,199.1862 L686.4583,188.7695 L497.9167,188.7695 A4.1667,4.1667 0 0 0 493.75,192.9362 " style="stroke:#033C73;stroke-width:1.0416666666666667;fill:none;"/><path d="M686.4583,188.7695 L686.4583,197.1029 A2.0833,2.0833 0 0 0 688.5417,199.1862 L696.875,199.1862 L686.4583,188.7695 " style="stroke:#033C73;stroke-width:1.0416666666666667;fill:none;"/><text fill="#033C73" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="119.7917" x="505.2083" y="210.789">This could eg be a</text><text fill="#033C73" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="166.6667" x="505.2083" y="225.3398">sinatra-based application</text><text fill="#033C73" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="81.25" x="505.2083" y="239.8905">that use the</text><text fill="#033C73" font-family="monospace" font-size="12.5" lengthAdjust="spacing" textLength="167.7083" x="505.2083" y="254.4413">Giblish::RequestManager</text><text fill="#033C73" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="37.5" x="505.2083" y="268.9921">class.</text><polygon fill="#2FA4E7" points="195.3125,329.1667,205.7292,333.3333,195.3125,337.5,199.4792,333.3333" style="stroke:#2FA4E7;stroke-width:1.0416666666666667;"/><line style="stroke:#2FA4E7;stroke-width:3.125;" x1="34.8958" x2="201.5625" y1="333.3333" y2="333.3333"/><text fill="#343A40" font-family="Verdana" font-size="12.5" font-weight="bold" lengthAdjust="spacing" textLength="8.3333" x="47.3958" y="315.8183">1</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="87.5" x="70.3125" y="308.5429">Search Query</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="76.0417" x="70.3125" y="323.0937">(html POST)</text><polygon fill="#2FA4E7" points="385.9375,383.2682,396.3542,387.4349,385.9375,391.6016,390.1042,387.4349" style="stroke:#2FA4E7;stroke-width:1.0416666666666667;"/><line style="stroke:#2FA4E7;stroke-width:3.125;" x1="207.8125" x2="392.1875" y1="387.4349" y2="387.4349"/><text fill="#343A40" font-family="Verdana" font-size="12.5" font-weight="bold" lengthAdjust="spacing" textLength="8.3333" x="220.3125" y="369.9198">2</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="65.625" x="243.2292" y="362.6444">hand over</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="88.5417" x="243.2292" y="377.1952">POST request</text><polygon fill="#2FA4E7" points="582.8125,437.3698,593.2292,441.5365,582.8125,445.7031,586.9792,441.5365" style="stroke:#2FA4E7;stroke-width:1.0416666666666667;"/><line style="stroke:#2FA4E7;stroke-width:3.125;" x1="398.4375" x2="589.0625" y1="441.5365" y2="441.5365"/><text fill="#343A40" font-family="Verdana" font-size="12.5" font-weight="bold" lengthAdjust="spacing" textLength="8.3333" x="410.9375" y="424.0214">3</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="65.625" x="433.8542" y="416.746">hand over</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="88.5417" x="433.8542" y="431.2968">POST request</text><polygon fill="#2FA4E7" points="741.1458,491.4714,751.5625,495.638,741.1458,499.8047,745.3125,495.638" style="stroke:#2FA4E7;stroke-width:1.0416666666666667;"/><line style="stroke:#2FA4E7;stroke-width:3.125;" x1="595.3125" x2="747.3958" y1="495.638" y2="495.638"/><text fill="#343A40" font-family="Verdana" font-size="12.5" font-weight="bold" lengthAdjust="spacing" textLength="8.3333" x="607.8125" y="478.123">4</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="71.875" x="630.7292" y="470.8476">Search the</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="34.375" x="630.7292" y="485.3984">index</text><polygon fill="#2FA4E7" points="409.8958,570.5241,399.4792,574.6908,409.8958,578.8574,405.7292,574.6908" style="stroke:#2FA4E7;stroke-width:1.0416666666666667;"/><line style="stroke:#2FA4E7;stroke-width:3.125;" x1="403.6458" x2="594.2708" y1="574.6908" y2="574.6908"/><text fill="#343A40" font-family="Verdana" font-size="12.5" font-weight="bold" lengthAdjust="spacing" textLength="8.3333" x="421.3542" y="557.1757">5</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="92.7083" x="444.2708" y="549.9003">Return search</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="80.2083" x="444.2708" y="564.4511">result (html)</text><path d="M600,513.3464 L600,597.7214 A4.1667,4.1667 0 0 0 604.1667,601.888 L812.5,601.888 A4.1667,4.1667 0 0 0 816.6667,597.7214 L816.6667,519.5964 L806.25,509.1797 L604.1667,509.1797 A4.1667,4.1667 0 0 0 600,513.3464 " style="stroke:#033C73;stroke-width:1.0416666666666667;fill:none;"/><path d="M806.25,509.1797 L806.25,517.513 A2.0833,2.0833 0 0 0 808.3333,519.5964 L816.6667,519.5964 L806.25,509.1797 " style="stroke:#033C73;stroke-width:1.0416666666666667;fill:none;"/><text fill="#033C73" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="135.4167" x="611.4583" y="531.1991">Giblish contains help</text><text fill="#033C73" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="136.4583" x="611.4583" y="545.7499">classes fthat provide</text><text fill="#033C73" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="156.25" x="611.4583" y="560.3007">most of the heavy lifting</text><text fill="#033C73" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="184.375" x="611.4583" y="574.8515">for retrieving and formatting</text><text fill="#033C73" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="116.6667" x="611.4583" y="589.4023">the search result.</text><polygon fill="#2FA4E7" points="219.2708,649.5768,208.8542,653.7435,219.2708,657.9102,215.1042,653.7435" style="stroke:#2FA4E7;stroke-width:1.0416666666666667;"/><line style="stroke:#2FA4E7;stroke-width:3.125;" x1="213.0208" x2="397.3958" y1="653.7435" y2="653.7435"/><text fill="#343A40" font-family="Verdana" font-size="12.5" font-weight="bold" lengthAdjust="spacing" textLength="8.3333" x="230.7292" y="636.2284">6</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="92.7083" x="253.6458" y="628.953">Return search</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="80.2083" x="253.6458" y="643.5038">result (html)</text><polygon fill="#2FA4E7" points="46.3542,703.6784,35.9375,707.8451,46.3542,712.0117,42.1875,707.8451" style="stroke:#2FA4E7;stroke-width:1.0416666666666667;"/><line style="stroke:#2FA4E7;stroke-width:3.125;" x1="40.1042" x2="206.7708" y1="707.8451" y2="707.8451"/><text fill="#343A40" font-family="Verdana" font-size="12.5" font-weight="bold" lengthAdjust="spacing" textLength="8.3333" x="57.8125" y="690.33">7</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="92.7083" x="80.7292" y="683.0546">Return search</text><text fill="#343A40" font-family="Verdana" font-size="12.5" lengthAdjust="spacing" textLength="80.2083" x="80.7292" y="697.6054">result (html)</text><!--MD5=[13204aa85ad97e6fa7eec39605455a40]
2
+ @startuml
3
+ !theme cerulean-outline
4
+ hide footbox
5
+ autonumber
6
+
7
+ title "Using a Passenger web-app for search requests"
8
+
9
+ actor Viewer as Vi
10
+
11
+ box "Document-hosting Server" #EEEEEE
12
+ participant "Web Server" as Webserv
13
+ participant "Passenger" as Pass
14
+ participant "Search script\n(Web app)" as Searcher
15
+ note over of Searcher
16
+ This could eg be a
17
+ sinatra-based application
18
+ that use the
19
+ ""Giblish::RequestManager""
20
+ class.
21
+ end note
22
+ database "Search index" as Index
23
+ end box
24
+
25
+ Vi -> Webserv : Search Query\n(html POST)
26
+ Webserv -> Pass : hand over\nPOST request
27
+ Pass -> Searcher : hand over\nPOST request
28
+ Searcher -> Index : Search the\nindex
29
+ Searcher -> Pass : Return search\nresult (html)
30
+ note right
31
+ Giblish contains help
32
+ classes fthat provide
33
+ most of the heavy lifting
34
+ for retrieving and formatting
35
+ the search result.
36
+ end note
37
+ Pass -> Webserv : Return search\nresult (html)
38
+ Webserv -> Vi : Return search\nresult (html)
39
+ @enduml
40
+
41
+ @startuml
42
+
43
+
44
+
45
+ skinparam backgroundColor transparent
46
+ skinparam useBetaStyle false
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+ skinparam defaultFontName "Verdana"
55
+ skinparam defaultFontSize 12
56
+ skinparam dpi 100
57
+ skinparam shadowing false
58
+ skinparam roundcorner 8
59
+ skinparam ParticipantPadding 40
60
+ skinparam BoxPadding 40
61
+ skinparam Padding 5
62
+ skinparam ArrowColor #868E96
63
+ skinparam stereotype {
64
+ CBackgroundColor #EDF0F2
65
+ CBorderColor #BABDBF
66
+ ABackgroundColor #8FB961
67
+ ABorderColor $SUCCESS_DARK
68
+ IBackgroundColor #D2494E
69
+ IBorderColor $DANGER_DARK
70
+ EBackgroundColor #E47833
71
+ EBorderColor $WARNING_DARK
72
+ NBackgroundColor #35638F
73
+ NBorderColor $INFO_DARK
74
+ }
75
+ skinparam title {
76
+ FontColor #2FA4E7
77
+ BorderColor #BABDBF
78
+ FontSize 20
79
+ BorderRoundCorner 8
80
+ BorderThickness 1
81
+ BackgroundColor transparent
82
+ }
83
+
84
+ skinparam legend {
85
+ BackgroundColor transparent
86
+ BorderColor #BABDBF
87
+ FontColor #343A40
88
+ }
89
+
90
+ skinparam swimlane {
91
+ BorderColor #033C73
92
+ BorderThickness 2
93
+ TitleBackgroundColor #EDF0F2-#E9ECEF
94
+ TitleFontColor #2FA4E7
95
+ }
96
+
97
+
98
+ skinparam activity {
99
+ FontColor #2FA4E7
100
+ BorderColor #2FA4E7
101
+ BackgroundColor transparent
102
+ BarColor #73A839
103
+ StartColor #033C73
104
+ EndColor #033C73
105
+ DiamondBackgroundColor transparent
106
+ DiamondBorderColor #BABDBF
107
+ DiamondFontColor #BABDBF
108
+ }
109
+
110
+
111
+ skinparam participant {
112
+ FontColor #2FA4E7
113
+ BorderColor #2FA4E7
114
+ BackgroundColor transparent
115
+ ParticipantBorderThickness 2
116
+ }
117
+
118
+
119
+ skinparam actor {
120
+ FontColor #2FA4E7
121
+ BorderColor #2FA4E7
122
+ BackgroundColor transparent
123
+ }
124
+
125
+
126
+ skinparam arrow {
127
+ Thickness 3
128
+ Color #2FA4E7
129
+ FontColor #343A40
130
+ }
131
+
132
+
133
+ skinparam sequence {
134
+ BorderColor #2FA4E7
135
+ TitleFontColor #2FA4E7
136
+ BackgroundColor transparent
137
+ StartColor #2FA4E7
138
+ EndColor #2FA4E7
139
+ BoxBackgroundColor transparent
140
+ BoxBorderColor #868E96
141
+ BoxFontColor #343A40
142
+ LifeLineBorderColor #BABDBF
143
+ LifeLineBorderThickness 2
144
+ LifeLineBackgroundColor transparent
145
+ GroupBorderColor #868E96
146
+ GroupFontColor #343A40
147
+ GroupHeaderFontColor #033C73
148
+ DividerBackgroundColor transparent
149
+ DividerBorderColor #868E96
150
+ DividerBorderThickness 2
151
+ DividerFontColor #343A40
152
+ ReferenceBackgroundColor transparent
153
+ ReferenceBorderColor #868E96
154
+ ReferenceFontColor #343A40
155
+ ReferenceHeaderFontColor #033C73
156
+ }
157
+
158
+
159
+ skinparam partition {
160
+ BorderColor #2FA4E7
161
+ FontColor #2FA4E7
162
+ BackgroundColor transparent
163
+ }
164
+
165
+
166
+ skinparam collections {
167
+ FontColor #2FA4E7
168
+ BorderColor #2FA4E7
169
+ BackgroundColor transparent
170
+ }
171
+
172
+
173
+ skinparam control {
174
+ FontColor #2FA4E7
175
+ BorderColor #2FA4E7
176
+ BackgroundColor transparent
177
+ }
178
+
179
+
180
+ skinparam entity {
181
+ FontColor #2FA4E7
182
+ BorderColor #2FA4E7
183
+ BackgroundColor transparent
184
+ }
185
+
186
+
187
+ skinparam boundary {
188
+ FontColor #2FA4E7
189
+ BorderColor #2FA4E7
190
+ BackgroundColor transparent
191
+ }
192
+
193
+
194
+ skinparam agent {
195
+ BackgroundColor transparent
196
+ BorderColor #999999
197
+ FontColor #333333
198
+ }
199
+
200
+
201
+ skinparam note {
202
+ BorderThickness 1
203
+ BackgroundColor transparent
204
+ BorderColor #033C73
205
+ FontColor #033C73
206
+ }
207
+
208
+
209
+ skinparam artifact {
210
+ BackgroundColor transparent
211
+ BorderColor #868E96
212
+ FontColor #868E96
213
+ }
214
+
215
+
216
+ skinparam component {
217
+ FontColor #2FA4E7
218
+ BorderColor #2FA4E7
219
+ BackgroundColor transparent
220
+ }
221
+
222
+
223
+ skinparam interface {
224
+ BackgroundColor transparent
225
+ BorderColor #C71C22
226
+ FontColor #343A40
227
+ }
228
+
229
+
230
+ skinparam storage {
231
+ BackgroundColor transparent
232
+ BorderColor #DD5600
233
+ FontColor #DD5600
234
+ }
235
+
236
+
237
+ skinparam node {
238
+ BackgroundColor transparent
239
+ BorderColor #343A40
240
+ FontColor #343A40
241
+ }
242
+
243
+
244
+ skinparam cloud {
245
+ BackgroundColor #F2FCFE-#eeeeee
246
+ BorderColor #F2FCFE
247
+ FontColor #343A40
248
+ }
249
+
250
+
251
+ skinparam database {
252
+ FontColor #2FA4E7
253
+ BorderColor #2FA4E7
254
+ BackgroundColor transparent
255
+ }
256
+
257
+
258
+ skinparam class {
259
+ FontColor #2FA4E7
260
+ BorderColor #2FA4E7
261
+ BackgroundColor transparent
262
+ FontColor #F8F9FA
263
+ HeaderBackgroundColor #2FA4E7-#2683B9
264
+ StereotypeFontColor #343A40
265
+ BorderThickness 1
266
+ AttributeFontColor #343A40
267
+ AttributeFontSize 11
268
+ }
269
+
270
+
271
+ skinparam object {
272
+ FontColor #2FA4E7
273
+ BorderColor #2FA4E7
274
+ BackgroundColor transparent
275
+ StereotypeFontColor #343A40
276
+ BorderThickness 1
277
+ AttributeFontColor #BABDBF
278
+ AttributeFontSize 11
279
+ }
280
+
281
+
282
+ skinparam usecase {
283
+ FontColor #2FA4E7
284
+ BorderColor #2FA4E7
285
+ BackgroundColor transparent
286
+ BorderThickness 2
287
+ StereotypeFontColor #2FA4E7
288
+ }
289
+
290
+
291
+ skinparam rectangle {
292
+ FontColor #2FA4E7
293
+ BorderColor #2FA4E7
294
+ BackgroundColor transparent
295
+ BorderThickness 2
296
+ StereotypeFontColor #2FA4E7
297
+ }
298
+
299
+
300
+ skinparam package {
301
+ BackgroundColor transparent
302
+ BorderColor #2FA4E7
303
+ FontColor #2FA4E7
304
+ BorderThickness 2
305
+ }
306
+
307
+
308
+ skinparam folder {
309
+ BackgroundColor transparent
310
+ BorderColor #DD5600
311
+ FontColor #DD5600
312
+ BorderThickness 2
313
+ }
314
+
315
+
316
+ skinparam frame {
317
+ BackgroundColor transparent
318
+ BorderColor #033C73
319
+ FontColor #033C73
320
+ BorderThickness 2
321
+ }
322
+
323
+
324
+ skinparam state {
325
+ FontColor #2FA4E7
326
+ BorderColor #2FA4E7
327
+ BackgroundColor transparent
328
+ StartColor #033C73
329
+ EndColor #033C73
330
+ AttributeFontColor #BABDBF
331
+ AttributeFontSize 11
332
+ }
333
+
334
+
335
+ skinparam queue {
336
+ FontColor #2FA4E7
337
+ BorderColor #2FA4E7
338
+ BackgroundColor transparent
339
+ }
340
+
341
+
342
+ skinparam card {
343
+ BackgroundColor transparent
344
+ BorderColor #033C73
345
+ FontColor #033C73
346
+ }
347
+
348
+
349
+ skinparam file {
350
+ BackgroundColor transparent
351
+ BorderColor #868E96
352
+ FontColor #868E96
353
+ }
354
+
355
+
356
+ skinparam stack {
357
+ FontColor #2FA4E7
358
+ BorderColor #2FA4E7
359
+ BackgroundColor transparent
360
+ }
361
+
362
+
363
+
364
+ hide footbox
365
+ autonumber
366
+
367
+ title "Using a Passenger web-app for search requests"
368
+
369
+ actor Viewer as Vi
370
+
371
+ box "Document-hosting Server" #EEEEEE
372
+ participant "Web Server" as Webserv
373
+ participant "Passenger" as Pass
374
+ participant "Search script\n(Web app)" as Searcher
375
+ note over of Searcher
376
+ This could eg be a
377
+ sinatra-based application
378
+ that use the
379
+ ""Giblish::RequestManager""
380
+ class.
381
+ end note
382
+ database "Search index" as Index
383
+ end box
384
+
385
+ Vi -> Webserv : Search Query\n(html POST)
386
+ Webserv -> Pass : hand over\nPOST request
387
+ Pass -> Searcher : hand over\nPOST request
388
+ Searcher -> Index : Search the\nindex
389
+ Searcher -> Pass : Return search\nresult (html)
390
+ note right
391
+ Giblish contains help
392
+ classes fthat provide
393
+ most of the heavy lifting
394
+ for retrieving and formatting
395
+ the search result.
396
+ end note
397
+ Pass -> Webserv : Return search\nresult (html)
398
+ Webserv -> Vi : Return search\nresult (html)
399
+ @enduml
400
+
401
+ PlantUML version 1.2021.7(Sun May 23 14:40:07 CEST 2021)
402
+ (GPL source distribution)
403
+ Java Runtime: OpenJDK Runtime Environment
404
+ JVM: OpenJDK 64-Bit Server VM
405
+ Default Encoding: UTF-8
406
+ Language: en
407
+ Country: US
408
+ --></g></svg>
@@ -0,0 +1,180 @@
1
+ = Trigger document generation
2
+ :imagesdir: trigger_generation_im
3
+ :numbered:
4
+ :docid: G-003
5
+ :toc: left
6
+
7
+ == Purpose
8
+
9
+ To describe how to use `giblish` as a tool for creating a static web site backed by a git repo that is automatically generated each time a contributor push changes to the git repo.
10
+
11
+ This text covers the followwing deployment scenarios:app-name:
12
+
13
+ . Using a git hook together with a simple (well) shell script
14
+ . Using a git hook together with Jenkins.
15
+
16
+ They have been tested on Linux servers (Ubuntu). Most of the tools and scripts should work on a Windows server as well but might need some tweaking and is, again, not tested.
17
+
18
+ If you want to dive straight in and setup one of the scenarios below, jump to <<setup_instructions>>, otherwise read on for some examples and considerations.
19
+
20
+ == Git hook and shell script
21
+
22
+ This requires the least number of dependencies to work but is more limited.
23
+
24
+ .Deploy using git hook and shell script
25
+ image::deploy_with_hooks.svg[]
26
+
27
+ The components needed on the server are:
28
+
29
+ A 'Main Repo'::
30
+ The common (bare) git repo used by all content writers to push updates to. This repo shall be setup with a server-side hook (_post-receive_) that initiates the html generation and is triggered by each push to the repo.
31
+
32
+ A 'Staging Repo'::
33
+ A mirror of the _Main Repo_ that fulfills two functions:
34
+
35
+ . to provide a checked-out working tree with the source files (adoc files).
36
+ . to provide a script that uses giblish to generate html documents and publish those docs to a location where a web server can access them.
37
+
38
+ Web Server::
39
+ Apache, Ngnix or other web server that provides clients with HTML pages located somewhere on the file system on the server (e.g under /var/www/... )
40
+
41
+ === Pros & Cons
42
+
43
+ Pros::
44
+ * it has few dependencies on external tools, only git, giblish and a web server are needed for this to work.
45
+ * giblish provides templates for the `post-receive` hook.
46
+
47
+ Cons::
48
+ * The hook and publish scripts provided with giblish runs synchronously at each push from a _Doc Writer_ to the _Main Repo_. The time it takes to generate the HTML docs from the adoc source will thus be added to each push to the _Main Repo_.
49
+ * You need to manually setup the _Staging Repo_ on the server and this is a bit more 'hackish' than letting a build orchestrator tool implement a proper 'build' of your documents. You might for example end up with race conditions if two pushes to the _Main Repo_ are done close in time.
50
+
51
+ === Using a combination of Jenkins and git hook
52
+
53
+ This setup adds a Jenkins (or similar build orchestrator) installation so it is more tools to setup but offer more flexibility and performance. It is also more robust and thus more 'production friendly'.
54
+
55
+ If you are already doing some kind of development, chances are that you already have this kind of setup as a CI pipeline.
56
+
57
+ .Deploy using Jenkins
58
+ image::deploy_with_jenkins.svg[]
59
+
60
+ The components needed on the server are:
61
+
62
+ Main Repo::
63
+ The common (bare) git repo used by all content writers to push updates to. This repo needs to be setup with a server-side hook (_post-receive_) that are executed by git after each push to the repository.
64
+
65
+ Jenkins instance::
66
+ A running instance of Jenkins and one or more defined build jobs that use giblish to build the HTML documents.
67
+
68
+ Web Server::
69
+ Apache, Ngnix or other web server that provides clients with HTML pages located somewhere on the file system on the server (e.g under /var/www/... )
70
+
71
+ ==== Pros & cons
72
+
73
+ Pros::
74
+ * Using Jenkins enables a lot of flexibility and scaleability. You can setup multiple Jenkins agents to increase performance, you can define many build jobs where each job builds either a particular branch from a particular git repo or many branches from one or many repos.
75
+
76
+ Cons::
77
+ * You need to be familiar with, and maintain, the Jenkins instance.
78
+
79
+ [[setup_instructions]]
80
+ == Setup instructions
81
+
82
+ Follow the instructions below to get one of the above setups running on your server.
83
+
84
+ === Some preliminary notes
85
+
86
+ IMPORTANT: Setting up permissions and secure your setup from unwanted access is outside the scope of these instructions. You must understand and implement the proper user/groups/rules for your use case.
87
+
88
+ NOTE: git server side hooks are used in the instructions below. For details on git hooks see https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks[this doc].
89
+
90
+ [[common_setup]]
91
+ === Initial setup
92
+
93
+ These steps are common to both deployment scenarios.
94
+
95
+ giblish setup::
96
+ . Install ruby on the _Server_ (a version no more than 18 months old)
97
+ . Install giblish on the _Server_ using `gem install giblish`
98
+
99
+ git and gitrepo setup::
100
+ . Install git on the _Server_.
101
+ . Setup the *bare* _Main Repo_ on the _Server_ by either.
102
+ .. Copy a bare repo you already use to the _Server_ file system.
103
+ .. Initiate a new repo using `git init --bare <your_repo_name>` somewhere on the _Server_ file system.
104
+ +
105
+ NOTE: If you start with an empty, bare, _Main Repo_ on the _Server_, it is a good idea to directly clone it to your local machine, commit some content to the 'master' branch and push the result back to the _Main Repo_. An empty, bare repo does not even contain a 'master' branch from the start and this can lead to some edge cases that complicate things.
106
+
107
+ === Use a git hook and shell script
108
+
109
+ First, follow the steps described in <<common_setup>>. Then proceed with the steps below.
110
+
111
+ . Setup the _Staging Repo_ on the _Server_ by cloning the _Main Repo_ to a suitable folder in the _Server_ file system, ex:
112
+ +
113
+ .Setup a staging repo in your home folder on the _Server_
114
+ ====
115
+ [source, bash]
116
+ ----
117
+ # go to your home directory
118
+ cd ~
119
+
120
+ # clone the Main Repo, assuming it is located at /usr/local/main_repo.git
121
+ git clone file:///usr/local/main_repo.git
122
+ ----
123
+ ====
124
+ . Make a copy of the `post-receive.example` template from the installed `giblish` gem.
125
+ +
126
+ .Find the `post-receive` template in the giblish gem
127
+ ====
128
+ On a server running Ubuntu 16.04, `gem which giblish` returns:
129
+
130
+ /var/lib/gems/2.6.0/gems/giblish-0.7.0/lib/giblish.rb
131
+
132
+ and the template hook can be found under
133
+
134
+ /var/lib/gems/2.6.0/gems/giblish-0.7.0/scripts/hooks/post-receive.example
135
+ ====
136
+
137
+ . Rename the copy to `post-receive`
138
+ . Tweak the configuration variables of the copy to suite your use case.
139
+ . Move your copy to the `hooks` directory of your _Main Repo_.
140
+ . Set the execute permission using `chmod +x post-receive`
141
+
142
+ That's it. You can now push to your _Main Repo_ and the `post-receive` hook will run `giblish` on the branches that you set it up to.
143
+
144
+ === Setup the git hook and Jenkins scenario
145
+
146
+ TBD...
147
+
148
+ First, follow the steps described in <<common_setup>>. Then proceed with the steps below.
149
+
150
+ ==== Sequence for generating documents
151
+
152
+ The following image shows how the sequence from user commit to generated documents.
153
+
154
+ .Sequence diagram for generating docs from adoc
155
+ image::Render Documents.png[]
156
+
157
+ [appendix]
158
+ == Template scripts
159
+
160
+ .The giblish `post-receive` template git hook
161
+ [%collapsible]
162
+ ====
163
+ [source,bash]
164
+ ----
165
+ include::../scripts/hooks/post-receive.example[]
166
+ ----
167
+ ====
168
+
169
+ === post-update hook
170
+
171
+ Below is an example of a `post-update` hook that triggers Jenkins jobs after a push to a git repo. This hook should be installed on the server side git repository to trigger Jenkins builds
172
+
173
+ .Example of a git hook triggering Jenkins builds
174
+ [%collapsible]
175
+ ====
176
+ [source,bash]
177
+ ----
178
+ include::../docgen/scripts/githook_examples/post-update.example[]
179
+ ----
180
+ ====
@@ -0,0 +1,51 @@
1
+ @startuml
2
+ !theme cerulean-outline
3
+ ' !theme spacelab
4
+ hide footbox
5
+ autonumber
6
+
7
+ title "Generate docs via GitHub web hook"
8
+
9
+ box "GitHub" #EEEEEE
10
+ actor Editor as Ed
11
+ participant GitHub as GitHub
12
+ end box
13
+
14
+ box "Document Hosting Server" #EEEEEE
15
+ participant "Web Server" as Webserv
16
+ participant "Passenger" as Pass
17
+ participant "Document\nGenerator" as Docgen
18
+ note right of Docgen
19
+ This could be
20
+ a sinatra-based
21
+ application that
22
+ use giblish' helper
23
+ classes.
24
+ end note
25
+ end box
26
+
27
+
28
+ Ed -> GitHub : push doc update\nto repository
29
+ GitHub -> Webserv : send POST request
30
+ Webserv -> Pass : hand over\nPOST request
31
+ Pass -> Docgen : hand over\nPOST request
32
+ Docgen -> Docgen : generate\ndocumentation
33
+ note left
34
+ The documents are generated and stored\n
35
+ somewhere in the file system known to\n
36
+ the web server.
37
+ end note
38
+ /' You can also declare:
39
+
40
+ == Using raw git hook ==
41
+
42
+ Ed -> GitHub : push doc update to repository
43
+ GitHub -> Web server : send POST request
44
+ Webserv -> Pass : hand over POST request to passenger
45
+ Pass -> Docgen : hand over POST request to Sinatra
46
+ Docgen -> Docgen : generate documentation
47
+ '/
48
+
49
+ @enduml
50
+
51
+