SHARE
TWEET

Untitled

a guest Jun 27th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def getHelmSvc(Map helmSvc,String mservice){
  2.                 def domain = helmSvc[mservice].domain
  3.                 def microservice_name = helmSvc[mservice].microservice_name
  4.                 def ingress_required = helmSvc[mservice].ingress_required
  5.                 def var_map = [:]
  6.                 var_map['microservice_name'] = microservice_name
  7.                 var_map['ingress_required'] = ingress_required
  8.                 return var_map
  9.  
  10.         }
  11.      
  12. text1=new File('/jenkins/workspace/helm/helm_svc.yml').text
  13.  
  14.                     Yaml yaml = new Yaml()
  15.                     def obj = yaml.load(text1)
  16.  
  17.                     ret=getHelmSvc(obj, mservice)
  18.                     println ret
  19.      
  20. Basically it's printing on console:
  21.           {microservice_name=some-processor, ingress_required=false}
  22.      
  23. sh("""
  24.                       echo "$ret" >  "/jenkins/workspace/helm/map.yml"
  25.           """)
  26.      
  27. an exception which occurred:
  28. in field com.cloudbees.groovy.cps.impl.BlockScopeEnv.locals
  29. in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@2b3f4d48
  30. in field com.cloudbees.groovy.cps.impl.CallEnv.caller
  31. in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@2ee0ffec
  32. in field com.cloudbees.groovy.cps.Continuable.e
  33. in object org.jenkinsci.plugins.workflow.cps.SandboxContinuable@108a4042
  34. in field org.jenkinsci.plugins.workflow.cps.CpsThread.program
  35. in object org.jenkinsci.plugins.workflow.cps.CpsThread@28b2f39d
  36. in field org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.threads
  37. in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@1a7da7eb
  38. in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@1a7da7eb
  39.         Caused: java.io.NotSerializableException: org.yaml.snakeyaml.Yaml
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top