Jenkins Pipelines: Why is CPS Global Lib not loading? -


i'm following tutorial on pipeline library plugin. made repository containing following files:

d:. │   test.groovy │    ├───src └───vars         helloworld.groovy 

helloworld.groovy contains:

def call(name){     echo "hello world, ${name}" } 

test.groovy contains:

helloworld("joe") 

i installed pipeline plugins, in particular workflow-cps-global-lib-plugin. created new pipeline job in load repository , set script path test.groovy. when run job following error:

java.lang.nosuchmethoderror: no such dsl method 'helloworld' found among [archive, bat, build, catcherror, checkout, deletedir, dir, echo, emailext, error, fileexists, git, input, isunix, jiracomment, jiraissueselector, jirasearch, load, mail, node, parallel, properties, pwd, readfile, readtrusted, retry, sh, sleep, stage, stash, step, svn, timeout, tool, unarchive, unstash, waituntil, withenv, wrap, writefile, ws] 

why helloworld step not defined? here list of installed plugins: http://pastebin.com/ximmub8j

the pipeline global library expects git push event update jenkins embedded workflow-libs git repo.

a push triggers userdefinedglobalvariablelist.rebuild() method see: https://github.com/jenkinsci/workflow-cps-global-lib-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/cps/global/userdefinedglobalvariablelist.java

here groovy script pulls github repo jenkins workflow-libs repos , reloads without restart via:

//get pipeline global library jenkins extension rebuilds global library on git push list extensions = extensionlist.lookup(userdefinedglobalvariablelist.class); extensions.get(0).rebuild() //may want add check here make sure extensions isn't null


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -