Questions tagged [jenkins-job-builder]

Jenkins Job Builder takes simple descriptions of Jenkins jobs in YAML or JSON format and uses them to configure Jenkins. You can keep your job descriptions in human readable text format in a version control system to make changes and auditing easier. It also has a flexible template system, so creating many similarly configured jobs is easy.

Jenkins Job builder creates Jenkins XML configuration file from a YAML/JSON definition file and uploads it to Jenkins. JJB provides a convenient test command to allow you to validate the XML before you attempt to upload it to Jenkins.

An example job definition

- job:
    name: job-name
    project-type: freestyle
    defaults: global
    description: 'Do not edit this job through the web!'
    disabled: false
    display-name: 'Fancy job name'
    concurrent: true
    workspace: /srv/build-area/job-name
    quiet-period: 5
    block-downstream: false
    block-upstream: false
    retry-count: 3
    node: NodeLabel1 || NodeLabel2
    logrotate:
      daysToKeep: 3
      numToKeep: 20
      artifactDaysToKeep: -1
      artifactNumToKeep: -1

Once you’ve tested your job definition and are happy with it then you can use the update command to deploy the job to Jenkins.

jenkins-jobs update tests/yamlparser/fixtures/templates002.yaml

It will then appear in the UI of your Jenkins instance and can be run, viewed etc as any other job.

Online documentation: http://docs.openstack.org/infra/jenkins-job-builder/

83 questions
2
votes
1 answer

Add extra parameters at project or inherited job-template level

I'm looking for a way to allow some instances of a jjb job-template to add additional parameters, or add them via an inherited child template. The same thing really applies to any array/list/sequence-valued key. Instead of overriding the whole key,…
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
2
votes
2 answers

Place a Jenkins Job inside a folder using Jenkins Job Builder

I am trying to create a Jenkins Job inside a folder using Jenkins Job Builder, no luck so far ;( The following creates the job and the folder, but the job is not inside the folder ;( Please help contents of rest-framework.yaml - job: name:…
Krystian Marek
  • 331
  • 4
  • 19
2
votes
1 answer

Jenkins. How to stop run tests during every second build?

How to make Jenkins run tests only during every second build?
2
votes
1 answer

What is the difference between Jenkins SCM Sync configuration plugin and Jenkins Job Builder?

I am looking for possible solutions for maintaining Jenkins jobs and plugins configuration in Git. My motivation is easy (perhaps automated) backup of changes made on the Jenkins instance as well as a fast recovery in case I need to revert to a…
2
votes
2 answers

jenkins-job-builder doesn't propagate a variable value

I am using jenkins-job-builder to create my pipeline project. But I have a problem with the variables values when I am trying to reuse or propagating. It is my project configuration: - project: name: myproject git_url:…
Robert
  • 10,403
  • 14
  • 67
  • 117
1
vote
0 answers

JJB (Jenkins Job Builder) How to propagate variable into pipeline script?

I want to reuse one groovy script creating multiple jobs based on it. It looks good when you have similar jobs. I have something like this: my_definition.yml - project: name: my-project jobs: - my-jobs - job-group: name:…
1
vote
1 answer

Jenkins Job Builder / JJB "wrappers" don't have any effect on generated jobs

I'm currently trying to realize job timeouts, etc vi "wrappers" as described in the docs and some examples. Regardless whether I apply wrappers directly on jobs or on job templates or defaults, I can't see any effect on the generated XML. There is…
frans
  • 8,868
  • 11
  • 58
  • 132
1
vote
1 answer

Cannot find Additional Behaviours parameters in JJB

I am trying to create my jobs through JJB and almost all parameters are present. But I can't find the parameters for the repositories that are in the Additional Behaviours category. Tell me how to configure them using JJB? Maybe you need additional…
Dmytro
  • 11
  • 1
1
vote
0 answers

filter-by-name-wildcard does not work in Jenkins Job-Builder with git as it is in Jenkins web interface for multibranch pipeline

I am trying to setup a multibranch pipeline with Jenkins Job-builder. everything seems to work fine with the exception of filter by name (with wildcards) according to documentation in…
1
vote
0 answers

jenkins job builder - Multiple regex job filters when creating a list view

I am attempting to create a view through jjb that uses two regex job filters. regex-job is a dict but I am unable to get the syntax down. So far have tried things like - view: name: 'viewname' view-type: 'list' regex:…
1
vote
1 answer

Not able to pass value of variable from jenkins job builder defaults to groovy script

-defaults gitreponame: "ipsingh" Job Template job-template: name: '{name}-unit-test' project-type: pipeline dsl: !include-raw-escape: share.groovy share.groovy library 'jenkins-pipeline-library@master' appDeploy { inder = 'testing' gitreponame =…
1
vote
0 answers

Jenkins Job Builder Doubts using !join operator

I have few questions about how to use the Jenkins Job Builder, especially, with the !join operator. Let's say, I have the following YAML sample: - extended-choice: name: OPTIONS_CHECKBOX type: checkbox value: !join: - ',' …
1
vote
2 answers

Jenkins job builder: conditionally include builder and publisher

I have a set of Jenkins jobs that are substantially the same. I have created a job template that creates them all. However, some have builders that others don't (i.e. the first in the chain doesn't copy artifacts from another project) and others…
wrgrs
  • 2,467
  • 1
  • 19
  • 24
1
vote
0 answers

Jenkins Configuration with settings.XML file

How should I configure setting.xml in a Jenkins job to use the customized repository to download a jar while building, instead of the default repository?
Prabha
  • 11
  • 2
1
vote
1 answer

How do I get jenkins JJB to use jenkins environment vars? particularly for webhooks

We're on jenkins 2.108 and JJB 2.0.3 We've got a manually created job that gets activated by a git webhook. Part of that job gets info like the repo name and does stuff with it. Like this ./build_rpm.sh -C \${gitlabMergeRequestLastCommit} What the…
vmos
  • 109
  • 1
  • 2
  • 10