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
-1
votes
1 answer

Jenkins DSL - How to create directory?

folder('myfoler') {} Above DSL Syntax from https://jenkinsci.github.io/job-dsl-plugin/#path/folder allowing me to create a folder myfoler. I need to create a directory. Tried this: folder('myfoler/mysubfoler') {} This gives me error ERROR: Could…
anandhu
  • 686
  • 2
  • 13
  • 40
-1
votes
1 answer

In a Jenkins pipeline, how can I wait on post build actions of a step before moving to the next step?

My Jenkins pipeline is pipeline { agent any stages { stage('deploy') { steps { build(job: 'jobA') build(job: 'jobB') } } } } I want to run jobB when jobA is done.…
Thomas
  • 8,306
  • 8
  • 53
  • 92
-1
votes
1 answer

Send All Jenkins jobs build logs to central place and analyze the logs with key word match in automated way to mark it as either code issue etc

** I need a process to Send All Jenkins jobs build logs to central place and analyze the logs with key word match in automated way to mark it as either code issue or infra issue etc ** Please let me know is there way to achieve it.
-1
votes
1 answer

Send email to users irrespective of jenkins job status in scripted pipeline

I have Jenkins groovy scripted pipeline job and which has multiple stages and in one of the stage it will trigger the another job and in the end it will trigger the email and it is sending email only if all the stages passed successfully and if in…
-1
votes
1 answer

Using set flag to set true value with helm upgrade in Jenkinsfile

In my scripted pipeline, I have a shell script that performs helm upgrade and I have also set some environment variables like below: sh """helm upgrade --install ${someVar} chart-hub/java-${javaVersion} \ ... --set env.vars[1] .name=some_name_here…
-1
votes
1 answer

Declarative pipeline - Running a shell command

I have a jenkins pipeline script that I am updating wish to use the following shell command: sh script: """ export PATH=\"${PATH}\":\"${WORKSPACE}\" BASE_DIR=$(dirname $0) source "${BASE_DIR}/shellscript.sh" …
mac
  • 1,479
  • 3
  • 11
  • 21
-1
votes
2 answers

jenkins pipeline example for creating a folder with a description

I can do this manually in the console with a job dsl step, but can't figure out how to accomplish from a pipeline - declarative or scripted.
-1
votes
2 answers

Jenkins job dsl is not idempotent and triggers a branch scan every run

I use the job dsl to create multibranchPipelineJob jobs. In my job dsl script I create some multibranchPipelineJobs. If I run the seed job, no matter if the config changed or not, it triggers a branch scan job for all the multibranchPipelineJobs.…
red888
  • 27,709
  • 55
  • 204
  • 392
-1
votes
1 answer

Jenkins Multi Branch Pipeline error with Jenkins file

I have create a Jenkins Multi Branch pipeline where I have used below script to trigger a declarative steps from Github an Jenkins version 2.222.3 . pipeline { agent any stages { stage ('Compile Stage') { steps { …
-1
votes
2 answers

Jenkins, escape space character in jenkinsfile pipeline

i have next stage in my jenkins pipeline. stage('Test') { steps { bat "${KATALON} -noSplash -runMode=console -retry=0 -projectPath=${PRJ} -testSuitePath="Test Suites/IPM - REF" -executionProfile='CD2' -browserType='Web…
-1
votes
1 answer

Where can I find DSL documentations for a Jenkins plugin?

Im working with Jenkins DSL and pipelines. Where can I find DSL documentations for these plugins I've typically used GUIs to configure? I find it hard to imagine that when a new plugin is published that it already supports DSL. (Or are they written…
-1
votes
2 answers

Jenkins DSL Remove AuthToken

I would like to remove the authToken on existing jobs. When we run a provisioner script it created the authToken=secret, now we want to remove it. This is how it was created: configure { project -> ( project / 'authToken'…
ISZ
  • 1,027
  • 2
  • 14
  • 29
-1
votes
1 answer

Jenkins dsl configure block-generated XML doesn't match API

I am using a custom made plugin for our own company app in Jenkins. While converting all existing Jenkins jobs to DSL scripts, this means I need to use the configure block to include tasks that are run using this plugin. I thought I had written the…
shaneoh
  • 442
  • 2
  • 8
  • 26
-1
votes
2 answers

Job DSL Configure block to configure Sonar Properties in Jenkins Job

I am facing this particular error while configuring tag in config.xml configure{ node -> node / builders / 'hudson.plugins.sonar.SonarRunnerBuilder' { project('') properties((sonar.projectName):…
Anurag
  • 73
  • 8
-1
votes
2 answers

Trying to get a Jenkins job to create another job in a view

Ok so here is my dilemma, I am using some DSL groovy scripting for job creation in Jenkins and have run into a little snag. I am trying to get Jenkins to create the new job in a folder, in a specific view. When I run the job initially and it gives…
ChrisB.
  • 3
  • 4
1 2 3
56
57