This is working for me now, I think the issue was that my groovy file under /var/ was not camel case so it wasn't finding it (locally it was camel case but my source control didn't pick up the rename because it used to be name MyTest.groovy).
On Friday, August 25, 2017 at 11:14:30 AM UTC-4, Mark Waite wrote: > > Maybe you need a "return this" at the end of the groovy file (as in > https://github.com/docker/jenkins-pipeline-scripts/blob/master/src/com/docker/utilities/AWSSync.groovy > )? > > On Fri, Aug 25, 2017 at 9:08 AM red 888 <fakemai...@gmail.com > <javascript:>> wrote: > >> 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-use...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-users/cbd9d243-ee34-4cd4-89b8-8def41fdfa77%40googlegroups.com >> >> <https://groups.google.com/d/msgid/jenkinsci-users/cbd9d243-ee34-4cd4-89b8-8def41fdfa77%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- 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/9c8f9665-b751-4e03-a47b-d84007126d12%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.