jenkins-pipeline load scoping "method code too large" -


i'm setting pretty complex pipeline handle legacy builds. there 8 stages, , more on way - perhaps total of 12-15 stages.

each stage pretty similar actions: - take list, , each item - create entry in map - allocates node, , executes set of bat scripts (yes, windows) , run list in parallel

the current pipeline 1,000 lines long, , i'm getting "method large" error

i'm in process of refactoring dsl separate load-able scripts.

so far, good.
ran test indicates loading script additive overall pipeline. i'd learn best here.

test:

base.groovy:

def myvar      //wchi global (to basref, thought) def settest() { myvar='abc' } def gettest() { return myvar } 

pipeline.groovy

stage('one') {      def basref = load('base.groovy')      basref.settest()      echo basref.gettest() }  stage('two') {      def basref = load('base.groovy')      echo basref.gettest() } 

stage 1 shows "abc" expected. stage 2 shows "abc"

my ask:

how know using loadable files not result in "method large"?

what scope of loadable file?

i've tried setting basref = null allow garbage collection work, i'm not sure does.

thanks guidance on this.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -