简体   繁体   中英

Jenkins Pipeline: How to add help for Global Shared Library

According to documentation , it should be possible to include *.txt file with help/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 hosts scripts that define global variables accessible from Pipeline scripts. The basename of each *.groovy file should be a Groovy (~ Java) identifier, conventionally camelCased. The matching *.txt, if present, can contain documentation, processed through the system's configured markup formatter (so may really be HTML, Markdown, etc., though the txt extension is required).

Unfortunately it hasn't worked for me by simply creating *.txt with some arbitrary content.

Am I missing something? Or does Global Shared Library doesn't shown documentation in usual Jenkins places: 在此处输入图片说明

Please note that the PipelineSyntax/Global Variables Reference page is ONLY updated when the pipeline's run is successful. And therefore ONLY for this pipeline (and not any others).

Here's a link !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM