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

Using job-template for multiple jobs with overrided params

I need to extend the list of publishers for a single job in yamls. How can I do smth like that: job-template: name: "template name" publishers: - slack: room: "#room-1" project: name: "project name" jobs: -…
Egor
  • 153
  • 1
  • 2
  • 10
0
votes
1 answer

jenkins-job-builder generates wrong xml when using credentials plugin

We are using jenkins-job-builder in order to generate jenkins jobs, and we have an ongoing issue when we try to user ssh-credentials plug-in. When we create a new job which tries to use an ssh key the job fails with java.io.IOException: [ssh-agent]…
banyek
  • 238
  • 2
  • 8
0
votes
2 answers

Configuring plugins with Jenkins Job Builder

I'm trying to use Jenkins Job Builder to install jenkins plugins, but I misunderstand what JJB can do or I'm doing something wrong. I used the get-plugins-info command to get a YAML description of my plugins. Later, when rebuilding the jenkins…
abingham
  • 1,294
  • 1
  • 10
  • 17
0
votes
0 answers

Use Jenkins Environment Variable to automatically generate job name?

I am using Jenkins Job Generator Plugin to generate the job. Scenario: Testing is a main project. After successful completion and whenever a developer updates the repository it invokes Jenkins Job Generator Project and this job is responsible for…
0
votes
1 answer

Passing auth key to a container registry in Jenkins Job builder

I am trying to push a built docker container to a private registry and am having difficulty understanding how to pass the key safely and securely. I am able to successfully connect and push my container if I "build with parameters" in the Jenkins UI…
0
votes
2 answers

How to trigger build on multiple platforms using Jenkins pipeline?

I want to trigger Jenkins job on "hyp-z" and "hyp-x" build nodes. I tried to write it this way but getting "There are no nodes with the label ‘hyp-x&&hyp-z’" node ('hyp-z&&hyp-x') { // write something here } What is the mistake I am doing…
rameshthoomu
  • 1,234
  • 2
  • 17
  • 33
0
votes
1 answer

Jenkins Job Builder: place Job in an existing folder

I'd need to get started with JJB however one issue I'm facing is that I'm not able to upload jobs in an existing Folder (I'm using Cloudbees Folder plugin). I've arranged an example based on an existing question available on SO: - project: name:…
Francesco Marchioni
  • 4,091
  • 1
  • 25
  • 40
0
votes
2 answers

Jenkins Job Builder failing authentication with Jenkins due to encoding issue?

I'm trying to run jenkins-jobs update for the first time on my system, but it fails on authentication. Command: jenkins-jobs --conf ./jjb.ini update jobs/ Where jobs contains a test.yml - a miniature build project just for testing. jjb.ini…
jensmtg
  • 506
  • 5
  • 23
0
votes
3 answers

Jenkins job triggered twice

1) I am using Jenkins API to trigger a job, so when my monitoring tool sensu sends request Jenkins API to trigger jenkins JOb the build starts. 2) I have tried even manually by hitting buildnow instead of using API calls to make sure that it is not…
Cena
  • 55
  • 3
  • 8
0
votes
1 answer

How to override environment variables in jenkins_job_builder at job level?

I am trying to find a way to inherit/override environment variables in jenkins jobs defined via jenkins-job-builder (jjb). Here is one template that does not work: #!/usr/bin/env jenkins-jobs test - defaults: &sample_defaults name:…
sorin
  • 161,544
  • 178
  • 535
  • 806
0
votes
1 answer

Clone enterprise repository

I'm trying to clone a private github enterprise repository using jenkins job builder. How do I provide the username/password or API token of the github user so that jenkins can clone the directory? Doing all this through an ansible playbook, so…
Rohil
  • 177
  • 1
  • 3
  • 13
0
votes
1 answer

Creating global macros and templates in jenkins job builder

I currently have my jenkins job builder directory structure like so: jenkins ---global-defaults.yaml ---global-macros.yaml ---global-templates.yaml ---projectfolderA | ---projectA.yaml projectA.yaml can find the templates and…
Alec Xu
  • 21
  • 4
0
votes
1 answer

Run "From .." docker image inside Dockerfile

I'm building a image that builds a Jenkins and I try to use a plugin over the Jenkins when it is running, so, I need get run Jenkins before my plugin execution. I execute it like docker build -t dockerfile and the error which I am…
0
votes
1 answer

Jenkins job builder docker build and publish plugin issue

I am facing issue when Iam trying to build a Jenkins job using Jenkins job builder for docker build and publish plugin . I have 2 issues here : 1.) in repository tag it is not accepting "/" . 2.) registry url and password is not getting reflected…
0
votes
0 answers

Jenkins Job Builder - Cmake build-tool-invocations ignored

Here is what I am trying since couple of days: Created a job using Jenkins-job-builder. Created a cmake config and everything works except for build-tool-invocation. The build-tool-invocation is ignored when configuring. Please find in the…