In a shared library, what is the "vars/foo.txt" file USED for?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

In a shared library, what is the "vars/foo.txt" file USED for?

David Karr
So I now have a handful of pipeline scripts all reusing some global methods, all of which I pasted into each script, so I've started to set up a shared library to avoid duplication.

I'm using https://jenkins.io/doc/book/pipeline/shared-libraries/ as my implementation guide.

My questions have to do with the following block:

The vars directory hosts scripts that define global variables accessible from Pipeline. 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).

The first thing I need to define isn't what you might call a "global variable", but a method.  I know they are the same thing, but I think this could be clearer to people who are perhaps less than experts if this described "global variables or methods".  I'll submit that suggestion in a PR, but that's not quite what I'm asking about here.

I'm wondering about this "matching *.txt" file.  It says it "can contain documentation, ...".  The problem is, this page says nothing about how that documentation is used or presented. How is this file actually used?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e5b4d373-0cf5-40fe-ab46-76cb10bbdca3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: In a shared library, what is the "vars/foo.txt" file USED for?

red 888
Any word on this? I'm assuming no one is actually using this feature and its going to be deprecated because there is like zero documentation about where this is actually supposed to show up in jenkins. Is it under "Global Variables Reference" or "Step Reference"? I see my txt info no where and i don't even know where i am supposed to be looking for it.

On Sunday, February 5, 2017 at 8:33:03 PM UTC-5, David Karr wrote:
So I now have a handful of pipeline scripts all reusing some global methods, all of which I pasted into each script, so I've started to set up a shared library to avoid duplication.

I'm using <a href="https://jenkins.io/doc/book/pipeline/shared-libraries/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fbook%2Fpipeline%2Fshared-libraries%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzi5Xo827_lODtglxm9wkc-kRKTg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fbook%2Fpipeline%2Fshared-libraries%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzi5Xo827_lODtglxm9wkc-kRKTg&#39;;return true;">https://jenkins.io/doc/book/pipeline/shared-libraries/ as my implementation guide.

My questions have to do with the following block:

The vars directory hosts scripts that define global variables accessible from Pipeline. 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).

The first thing I need to define isn't what you might call a "global variable", but a method.  I know they are the same thing, but I think this could be clearer to people who are perhaps less than experts if this described "global variables or methods".  I'll submit that suggestion in a PR, but that's not quite what I'm asking about here.

I'm wondering about this "matching *.txt" file.  It says it "can contain documentation, ...".  The problem is, this page says nothing about how that documentation is used or presented. How is this file actually used?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/68410006-ce15-4ba3-9e64-c694d5ab6c8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: In a shared library, what is the "vars/foo.txt" file USED for?

Robert Hales
In reply to this post by David Karr
The .txt file shows up on the PipelineSyntax/Global Variables Reference page. 

On Sunday, February 5, 2017 at 6:33:03 PM UTC-7, David Karr wrote:
So I now have a handful of pipeline scripts all reusing some global methods, all of which I pasted into each script, so I've started to set up a shared library to avoid duplication.

I'm using <a href="https://jenkins.io/doc/book/pipeline/shared-libraries/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fbook%2Fpipeline%2Fshared-libraries%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzi5Xo827_lODtglxm9wkc-kRKTg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fbook%2Fpipeline%2Fshared-libraries%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzi5Xo827_lODtglxm9wkc-kRKTg&#39;;return true;">https://jenkins.io/doc/book/pipeline/shared-libraries/ as my implementation guide.

My questions have to do with the following block:

The vars directory hosts scripts that define global variables accessible from Pipeline. 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).

The first thing I need to define isn't what you might call a "global variable", but a method.  I know they are the same thing, but I think this could be clearer to people who are perhaps less than experts if this described "global variables or methods".  I'll submit that suggestion in a PR, but that's not quite what I'm asking about here.

I'm wondering about this "matching *.txt" file.  It says it "can contain documentation, ...".  The problem is, this page says nothing about how that documentation is used or presented. How is this file actually used?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4a067199-250a-45fb-9b06-33d026bf14c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: In a shared library, what is the "vars/foo.txt" file USED for?

red 888
Interesting I check there and didn't see them. Does this mean my txt files aren't formatted correctly? I just put a sentence in one to test.

On Monday, October 2, 2017 at 11:25:43 PM UTC-4, Robert Hales wrote:
The .txt file shows up on the PipelineSyntax/Global Variables Reference page. 

On Sunday, February 5, 2017 at 6:33:03 PM UTC-7, David Karr wrote:
So I now have a handful of pipeline scripts all reusing some global methods, all of which I pasted into each script, so I've started to set up a shared library to avoid duplication.

I'm using <a href="https://jenkins.io/doc/book/pipeline/shared-libraries/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fbook%2Fpipeline%2Fshared-libraries%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzi5Xo827_lODtglxm9wkc-kRKTg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fbook%2Fpipeline%2Fshared-libraries%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzi5Xo827_lODtglxm9wkc-kRKTg&#39;;return true;">https://jenkins.io/doc/book/pipeline/shared-libraries/ as my implementation guide.

My questions have to do with the following block:

The vars directory hosts scripts that define global variables accessible from Pipeline. 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).

The first thing I need to define isn't what you might call a "global variable", but a method.  I know they are the same thing, but I think this could be clearer to people who are perhaps less than experts if this described "global variables or methods".  I'll submit that suggestion in a PR, but that's not quite what I'm asking about here.

I'm wondering about this "matching *.txt" file.  It says it "can contain documentation, ...".  The problem is, this page says nothing about how that documentation is used or presented. How is this file actually used?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cba485b6-1c2d-4758-9346-b3a8581f2d76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

AW: In a shared library, what is the "vars/foo.txt" file USED for?

Reinhold Fuereder

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

 

I think even if for "vars/file.groovy" there is no corresponding "vars/file.txt", then the PipelineSyntax/Global Variables Reference page shows an "empty" entry for global var "file".

 

HTH Reinhold

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/C3D41C0B1D5991438F1A43F586F4B47F73F8D7C2%40TIGER2010.xortex.local.
For more options, visit https://groups.google.com/d/optout.