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

Trigger job in post build step(not post-build-action)on condition-step: current-status not able to trigger job

job: name: 'maven_job' project-type: maven description: "Modified job" concurrent: false scm: git: url: https://github.com/ranjitkumar518/myfirstrepo.git branches: - '${branch}' maven: maven-name: maven-3.2.1 root-pom: pom.xml goals:…
0
votes
2 answers

how to trigger jenkins downstream job only both upstreams jobs successfully executed

I have created Job A which looks for upstream jobs (Job B and Job C) success result and triggers a shell script to verify a condition. Once Job B and Job C executed successfully Job A executes downstream jobs (Job D and Job E). I have used reverse…
0
votes
1 answer

Jenkins Job Builder Configuration in Python

While updating the Jobs in Jenkins Job-Builder using jenkins-jobs update I'm getting the below error. INFO:root:Updating jobs in ['jobs'] ([]) Traceback (most recent call last): File "/usr/bin/jenkins-jobs", line 10, in
Rajavel
  • 11
  • 2
0
votes
1 answer

using maven-deploy for freestyle projects

I am in the process converting existing maven projects to freestyle projects, where the post-build step to deploy to repository are used only with maven project. what is the equivalent for implementing the below with a freestyle project type. Is…
askb
  • 6,501
  • 30
  • 43
0
votes
2 answers

Building code using JENKINS

I have configured JENKINS on my local machine . Now I have to build my code which is on my machine.  I have searched but all asking for git url and all. Just need to build code in my local folder.
Shah Rukh K
  • 559
  • 1
  • 5
  • 19
0
votes
0 answers

Jenkins Gerrit plugin offers patch revision instead of master following a merge to master

I experienced a merge order problem whereby a gerrit change ("100" for arguments sake) was code reviewed after a later change ("101") had been code reviewed. This caused jenkins to build and release gerrit ID "100", and the code previously released…
Jepper
  • 1,092
  • 3
  • 11
  • 24
0
votes
1 answer

Schedule a Jenkins Job to run hourly everyday but skip midnight (00:00) and resume again from 01:00 till 23:00

I have a Jenkins job which I would like to run from (01:00) 1 AM till (23:00) 11PM but skip midnight (00:00) and resume again from (01:00) on a daily basis. The thread How to schedule Jenkins job every Hour for the next 12 hours had this example H…
Sabz Mbatha
  • 201
  • 1
  • 2
  • 4
0
votes
1 answer

'PROJECT' is not a valid parameter. Did you mean null?

I have setup Gerrit and Jenkins. I have configured Jenkins' gerrit-trigger plugin so Gerrit changes are validated by Jenkins. Now, want to automatically create Jenkins jobs, using Jenkins jobgenerator plugin when a new repository is created in…
Franklin Piat
  • 3,952
  • 3
  • 32
  • 45
1 2 3 4 5
6