Questions tagged [jenkins-job-dsl]

Jenkins Job-DSL is a Jenkins plugin which enables the creation of Jenkins Jobs using Groovy scripts. It's available in the standard Jenkins plugin list.

For command reference see the Job DSL API Viewer.

Example of DSL script:

job('Hello World') {
  description 'A Simple Job'
  scm {
    github 'pdurbin/maven-hello-world'
  }
  steps {
    maven 'package', 'my-app/pom.xml'
  }
  publishers {
    archiveArtifacts 'build/**/jar'
  }
}

Links

844 questions
0
votes
1 answer

GitHub pull request builder DSL groovy syntax not working

I am trying to create Jenkins job for GitHub Pull Request bulder using DSL script but my groovy script is giving error please correct my code if i am using incorrect syntax. githubPullRequest { admin('user_1') admins(['user_2',…
0
votes
1 answer

Using Jenkins Job DSL plugin, why are the metrics (FindBugs, Checkstyle, PMD) only checked after the build?

Until recently, we created our Jenkins jobs by hand. We have a policy that the code is checked using FindBugs, Checkstyle and PMD, and any project that exceeds certain thresholds is considered unstable and is not allowed to deploy its artifact to…
eerriicc
  • 1,124
  • 4
  • 17
  • 29
0
votes
2 answers

How to perform a jenkins job save event through the Jenkins API in Groovy?

I'm using the ez-template to create a template and make other jobs, based on that template. Apparently, however, the template is only applied when you manually click either the save or apply buttons. I've used the following Jenkins Job DSL code to…
0
votes
2 answers

Using the ez-template plugin for Jenkins through the Jenkins Job DSL doesn't apply the template after creation

I am working on automating the creation of Jenkins jobs by using the Jenkins Job DSL (Groovy). Right now, I am trying to automate the creation of a job that uses the ez-template plugin to use an already existing template and apply that to my newly…
0
votes
0 answers

Failed to generate Violations(post build actions) using Job-DSL

I'm trying to convert a non-Jenkins DSL into DSL.The problem here is the violations part is missing. job('example') { publishers { violations(50) { sourcePathPattern('source pattern') …
Happy
  • 427
  • 2
  • 4
  • 17
0
votes
0 answers

how to use jenkins dsl-plugin to pull the DB for 500 applications

We have 500 applications running in prod and we have all the applications info in DB. We need to use jenkins job and tasks. In each job we will have 3 tasks to perform, i.e. read the application info from db into log stop the application verify the…
Sadhan
  • 15
  • 2
  • 9
0
votes
4 answers

start jenkins builds parallely?

I have 'n' no. of jobs, which I want to start simultaneously. Is it feasible in Jenkins? I tried using DSL plugin, work flow plugin. I have used 'parallel' method. I have my list of jobnames in an array/list and want to run them parallel. Please…
0
votes
1 answer

Jenkins job DSL - Build whenever an Ivy dependency is built

I have a DSL script that I'm using to create Ivy jobs. It's pretty much finished, except I cannot find how to disable the Build whenever an Ivy dependency is built from the job. I looked everywhere in the ivyJob element. Can someone please advise?
MisterStrickland
  • 947
  • 1
  • 15
  • 35
0
votes
1 answer

How to update Jenkins instance before testing?

The Problem I'm using Jenkins Job DSL to create my jobs and testing my scripts with Spock and jenkins-test-harness. I'm able to install new plugins with success, based on the Gradle example, but how can I update the plugins that already are…
user800014
0
votes
1 answer

How can I set the job timeout for all jobs using the Jenkins DSL

I read How can I set the job timeout using the Jenkins DSL. That sets the timeout for one job. I want to set it for all jobs, and with slightly different settings: 150%, averaged over 10 jobs, with a max of 30 minutes. According to the relevant…
Amedee Van Gasse
  • 7,280
  • 5
  • 55
  • 101
0
votes
1 answer

How to give "build run" Permission on a specific job to a user in Jenkins

We have a created a Job in jenkins. How can i give run permission to a user for this specific build Job. I have referred some Jenkins sites but not got a clear understanding. Thanks
Amit
  • 143
  • 5
  • 17
0
votes
1 answer

jenkins dsl with scriptler plugin in configure block not working

I am able to create a job using the jenkins playground here http://job-dsl.herokuapp.com/ to where the xml is exactly like the config.xml of a manually created job, but when i run the seed for the job the job in the script below is created, but my…
0
votes
1 answer

How to access Groovy file from Jenkins Seed Job using DSL

Create Jenkins Seed Job using DSL Plugin - Where i can pass Git Repo location to create the Jenkins jobs for the repo. The Job is created programmatically in the repo. Seed Job should read the groovy file in the repo and create the new job.
0
votes
1 answer

Does jenkins job dsl plugin support "parameter filter"?

Is "parameter filter" supported in Job DSL plugin? What I am trying to do is to copy artifacts from another project when the build parameter task_id has the same value as the current project, e.g. Build step: Copy artifacts from another…
Rongrong
  • 3
  • 1
0
votes
3 answers

Is it possible to override a Job DSL parameter?

We're using the Jenkins Job DSL plugin to configure all our jobs in code, and often use a local Jenkins staging environment to test in before deploying changes. We don't want our whole slew of hundreds of jobs to start building locally, though we do…
mrooney
  • 1,994
  • 2
  • 19
  • 30