Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53302

Pipeline script from SCM: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods round, org.codehaus.groovy.runtime.DefaultGroovyMethods toFloat

XMLWordPrintable

      In our project requirement we are using groovy default methods "toFloat(), round()" while calculating next release version automatically, but it seems these methods are not whitelisted and requires manual approval from script Approval. Can these be added to whitelist by default ?

      the sample code from pipeline script is below

       

      node("xxxx"){
       stage("get next version"){
       def last_tag = "1.2.0"
       def next_tag = (((last_tag.tokenize(".")[0] + "." + last_tag.tokenize(".")[1]).toFloat() + "0.1".toFloat()).round(2)) + "." + "0"
       sh "echo " + next_tag
       }
      }

       

            Unassigned Unassigned
            rgaduput Reddysekhar Gaduputi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: