I am using a groovy script to dynamically populate parameters and I am using Active Choices Reactive Parameter. In that plugin I have written a following groovy script
this.class.classLoader.addURL(new URL("file:///var/lib/jenkins/.groovy/grapes/org.yaml/snakeyaml/jars/snakeyaml-1.17.jar"))def url = 'g...@xxx.xxx.com:csd/deployment.git'
def envlist = ['/bin/bash', '-c', ' ssh-add /var/lib/jenkins/.ssh/id_rsa_git; cd /var/lib/jenkins/services/; git archive --remote='+ url +' master inventory | tar xvf -' ].execute().
envlist.waitFor()
def yaml = Class.forName("org.yaml.snakeyaml.Yaml").newInstance()
def config = yaml.load(new FileReader("/var/lib/jenkins/services/inventory/${SERVICES}.yml"))
return config.all.children."${SERVICES}".children.keySet()
NOTE: SERVICES is another defined parameter
Whereas when I use Active choice reactive reference parameter with same code:
Same groovy code works and prints out the following result
"[functional, staging_stable, pilot_stable, prod_stable]"
When I use script console in manage jenkins, it runs fine and prints me the same result
Result: [functional, staging_stable, pilot_stable, prod_stable]
How can I proceed with debugging, I want to only use Active Choices Reactive Parameter?
I have attached the screenshot to show how one is populated and one is not. Not enough to go through and debug this problem over the internet.
Can somebody please help?
Thankyou
Nishant