Questions tagged [groovy]

For questions about Groovy, which is an object-oriented programming language for Java.

7 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
2k views

How to define global variables in groovy file, which I want to load and consume?

I have a Jenkins parent groovy file which consumes the child groovy file Parent grooy file: ... def child = load 'child-groovy-file'; child.execute(); Child groovy file: a = "first letter"; b = "...
1
vote
1answer
689 views

Groovy script to show only selected item

I used jenkins Active choices plugin and Mavenmetadata plugin to build above UI. When I click a radio button particular version only should be display. How can I write a groovy script to fulfill above ...
1
vote
0answers
51 views

Pass Variable in pipeline script

I am trying to pass a variable input to "credentialsId: $creds" from SiteID but unable to. I tried multiple expressions in pipeline script with quotes etc and none worked. I am learning and need ...
0
votes
0answers
52 views

Can Load Shared Libraries in Jenkins But Not Able to Create New Objects

I am trying to implement Shared Libraries in my Jenkins scripted pipeline. I was able to configure Jenkins to pull the library from Git. I currently have one file, vars/Pipeline.groovy which I'm ...
0
votes
0answers
37 views

jenkins pipeline parameters grouping

I am using 'choice' parameter in Jenkins pipeline(Declarative) and I have over 25 different parameters. I am looking to group the parameters into 4/5 choices but still want the option to be able to ...
0
votes
0answers
28 views

How does an &&, || work with jenkins pipeline groovy?

I tried the below OR (||) expecting the build to fail if any of the myTeststring1 OR MyTestString2 matches the console output. I tried few other ways with ||, it doesn't work. Any suggestion? if (...
0
votes
1answer
22 views

How to assign saltstack pillar values from Jenkins comma separated input parameters?

I have a Jenkins job with string parameter as target "server1,server2". Jenkins pipeline script is expected to execute the job on server1 and server2 respectively. There is a common salt sls file that ...