Jenkins Pipeline: how to add help for the global shared library

According to the documentation, it should be possible to include the *.txtfile using / documentation:

(root)
 +- src                     # Groovy source files
 |   +- org
 |       +- foo
 |           +- Bar.groovy  # for org.foo.Bar class
 +- vars
 |   +- foo.groovy          # for global 'foo' variable/function
 |   +- foo.txt             # help for 'foo' variable/function
 +- resources               # resource files (external libraries only)
 |   +- org
 |       +- foo
 |           +- bar.json    # static helper data for org.foo.Bar

...

The vars directory contains scripts that define global variables available from Pipeline scripts. The base name of each * .groovy file must be Groovy identifier (~ Java), conditionally camelCased. * .txt compliance, if present, may contain documentation processed through the system markup format (so it really can be HTML, Markdown, etc., although the txt extension is required).

Unfortunately, this did not work for me, just creating *.txtwith some arbitrary content.

- ? : enter image description here

+4
1

, PipelineSyntax/Global Variables Reference . ( ).

!

+1

Source: https://habr.com/ru/post/1663834/


All Articles