简体   繁体   English

Jenkins Pipeline:如何为全局共享库添加帮助

[英]Jenkins Pipeline: How to add help for Global Shared Library

According to documentation , it should be possible to include *.txt file with help/documentation: 根据文档 ,应该可以在帮助/文档中包含*.txt文件:

 (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. vars目录托管脚本,这些脚本定义了可从Pipeline脚本访问的全局变量。 The basename of each *.groovy file should be a Groovy (~ Java) identifier, conventionally camelCased. 每个* .groovy文件的基本名称应该是Groovy(〜Java)标识符,通常是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). 匹配的* .txt(如果存在)可以包含通过系统配置的标记格式化程序处理的文档(因此可能确实是HTML,Markdown等,尽管需要txt扩展名)。

Unfortunately it hasn't worked for me by simply creating *.txt with some arbitrary content. 不幸的是,仅仅通过创建带有任意内容的*.txt并不能为我工作。

Am I missing something? 我想念什么吗? Or does Global Shared Library doesn't shown documentation in usual Jenkins places: 或者Global Shared Library没有在Jenkins的通常位置显示文档: 在此处输入图片说明

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 ! 这是一个链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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