Im trying to wrap my head around shared libraries (with descriptive not 
scripted pipelines) and I'm not sure how I should be doing this.

Right now I have this in my jenkinsfile:

def Storeinvar = powershell (
    script: '$PSVersionTable.PSVersion.major',
    returnStdout: true)

So I'm shelling out, running some command, and storing the result of that 
command in a var.

I want to put that in a shared library and call it anywhere in my 
jenkinsfile.

I created a file in my library: /var/myTest.groovy I put this in it to test:

def methA(body) {
     return 'FROM LIBRARY'}def methB(body) {
     return 'FROM LIBRARY'}

In my jenkinsfile i call them like this:

echo gitInfo.methA()
echo gitInfo.methB()

But i get this error:

groovy.lang.MissingPropertyException: No such property: myTest for class: 
groovy.lang.Binding


-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/cbd9d243-ee34-4cd4-89b8-8def41fdfa77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to