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

how to publish valgrind results using jenkins dsl script

How do I publish the generated valgrind results in jenkins using dsl script. I'm able to do publishers.archiveArtifacts / publishers.archiveJunit but I'm not able to do the same for valgrind. Following thing I tried but got following…
Shiva
  • 81
  • 2
  • 10
0
votes
1 answer

Need Help in Jenkins-Job DSL promotion

Iam working on creating a Build promotion using Jenkins-JOb DSL-Paramterized build. My Scripts looks as, Job('sampleMavenProj') { triggers { scm("*/5 * * * *") } scm { git('file:///work/SampleTest') …
Jagadish Tech
  • 129
  • 1
  • 2
  • 6
0
votes
1 answer

Job dsl to replicate existing Jenkins Job

I'm a noob to the groovy and came across the job-dsl Jenkins plugin which suits my requirement. My requirement is to replicate the existing Jenkins Job (say A) and create a new job B with only change as subversion URL (in the subversion plugin) in…
baba yaga
  • 119
  • 2
  • 10
0
votes
1 answer

How to clean up old build on Cloudbee and Jenkins?

I want to schedule a job to clean old build so I have configure the below scripts but its working at Jenkins script console and not for Jenkins job configuration. While running the job I am getting below error: Processing provided DSL script …
0
votes
1 answer

Append new pipeline to 'view listing sections' using Job DSL - Jenkins

Below is the config.xml for sectioned view plugin for section "View Listing Sections" pipeline view
shwetha
  • 376
  • 4
  • 7
  • 22
0
votes
1 answer

Jenkins-DSL deprication warnings on Jenkins 2.x

Currently I'm using Jenkins-dsl-core:1.43 and Jenkins 1.64. We are planning to migrate(upgrade) to latest version 2.x in near future. My DSL pretty much similar to https://github.com/sheehan/job-dsl-gradle-example . Does DSL support 2.x Version of…
Happy
  • 427
  • 2
  • 4
  • 17
0
votes
1 answer

Push a tag with Jenkins Job DSL

I want to add a tag to push to a remote repository So I create a job like this job('example-2') { scm { git('ssh://git@abc.git', 'branchName') } steps { shell('sh XXXX') } publishers { git { …
Jarod Ma
  • 21
  • 5
0
votes
1 answer

Use file features on Job DSL

I´m using Job DSL and I would like to download a file, read it, and set some env variables. def static setSecrets(Job delegate, Map overrides = [:]) { def liveUsername def livePassword def file new…
paul
  • 12,873
  • 23
  • 91
  • 153
0
votes
1 answer

Jenkins DSL for ci-skip plugin

I'm trying to configure the ci-skip plugin in a Jenkins DSL job. Since this plugin is not supported, I've written this configure block: mavenJob("testproject") { #... wrappers { configure { node -> node / 'buildWrappers' /…
legege
  • 421
  • 4
  • 12
0
votes
2 answers

Configuring Jenkins DSL with diskcheck plugin

I'm attempting to convert 200+ Jenkins jobs from their current GUI-made configurations to DSL scripts. It's a tedious process and really slow. Jenkins is running on a Windows 2012 server. The Jenkins version is 1.650 and we are using the Job DSL…
shaneoh
  • 442
  • 2
  • 8
  • 26
0
votes
1 answer

Jenkins Job DSL:I want to get branch with commit or tag

Following my title. I use the groovy to do that. But it doesn't work. who can ask me how do it? the following is my source: job("AAA") { parameters { stringParam('branch_name', 'master', 'input branch name') stringParam('commit_id', '123456',…
Jarod Ma
  • 21
  • 5
0
votes
1 answer

Jenkins Job DSL fails to accept any SVN credentials use in the seed job script

I'm using the Jenkins DSL for the first time to create some seed jobs. I want to use some SVN credentials in one of these but no matter what I try the seed job fails to create a new job when I run it as soon as I put the credentials in. The DSL…
shaneoh
  • 442
  • 2
  • 8
  • 26
0
votes
2 answers

how to create configure block via class in DSL

I want to create class that will add configure block to freestyle job I tried the below code class BuildFramework { static myConfiguration(dslFactory, product, version, owner) { dslFactory.configure { project -> project /…
Shurik
  • 562
  • 1
  • 7
  • 19
0
votes
0 answers

Jenkins pullRequest is deprecated

I'm getting this warning message in my builds: Warning: (PullRequestJob.groovy, line 3) pullRequest is deprecated And I realize that pullRequest should be changed to something else, but cannot figure specific steps to be taken. I tried to use…
Misha Slyusarev
  • 1,353
  • 2
  • 18
  • 45
0
votes
0 answers

How do you pass parameter to gradle from jenkins job dsl?

I have a job where I can pass in command line arguments like gradle -Pconf=prod build How do I pass arguments in jobs dsl? I tried the following but it doesn't work job("doSomething"){ steps { gradle('-Pconf=prod build') …
bluesman
  • 2,242
  • 2
  • 25
  • 35