Top "Jenkins-groovy" questions

Question regarding using groovy code in Jenkins, specifically in Jenkinsfile and groovy plugins

Strange variable scoping behavior in Jenkinsfile

When I run the below Jenkins pipeline script: def some_var = "some value" def pr() { def another_var = "another " + some_…

jenkins groovy jenkins-pipeline jenkins-groovy groovyshell
Using a groovy class in other jenkins groovy scripts

I have 4 groovy scripts (2 are dsl.groovy scripts): JobConfig.groovy: class JobConfig { final name JobConfig(map) { name = map['name'] } } topLevel.…

jenkins groovy jenkins-plugins jenkins-groovy
Catching multiple errors in Jenkins workflow

My workflow sends mails when it fails using a try-catch. i have also enable concurrency and with this, when multiple …

jenkins groovy jenkins-pipeline jenkins-groovy
Difference between execute groovy script and the execute system groovy script in jenkins?

Can anyone explain the different between the execute groovy script and the execute system groovy script in jenkins? And how …

jenkins groovy jenkins-groovy
Splitting a string using a delimiter in Groovy and avoiding IndexOutOfBoundsException

I want to split an input parameter inputDetails to unit level. I'm using tokenize for doing this. Here is my …

jenkins groovy jenkins-pipeline jenkins-groovy groovy-console
How to import a class from a Jenkins Shared Library into the pipeline

I was using some global methods in the /var directory of the shared library, and everything worked fine. Now I …

jenkins-pipeline jenkins-groovy
How to clone a github repository using Jenkins pipeline script?

I am relatively new to the CI/CD concept. I am trying to clone a Github repository using declarative pipeline …

jenkins github jenkins-plugins jenkins-groovy jenkins-github-plugin
Jenkins: set a parameter defaultValue dynamically

I'm trying to set up a multibranch pipeline configuration where the "Deploy" boolean checkbox is defaulted to true on non-production …

jenkins jenkins-pipeline jenkins-groovy
File not found in jenkins pipeline script

I'm trying to have a pipeline script currently running on our Jenkins master, execute on a remote Jenkins node. But …

jenkins-pipeline jenkins-groovy
How can I add git clone operation in inline groovy script

I want to clone repo using inline groovy script in jenkins. How can I execute git clone and build the …

git jenkins jenkins-groovy