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
0 answers

cp: failed to access '/root/apache-tomcat-10.0.27/webapps': Permission denied

I had created the AWS ubuntu server and installed Jenkins and tomcat servers on the same server where I had created Jenkins jobs by configuring cloning code from GitHub and installing maven for build process and have created the built step by…
0
votes
1 answer

How to use job-template and project in Jenkins Job Builder

I am trying to understand how the job-templates and projects are supposed to be used. After reading the documentation I came up with this: - project: name: project-name jobs: - 'alcatel-pipeline': svnurl:…
RhythmicDevil
  • 705
  • 5
  • 15
  • 31
0
votes
0 answers

Configure job-dsl using scriptler

I'm going to write a freestyle job using job-dsl. job should build the scriptler script. I have experience writing a similar job for a pipeline. I don't know what it should look like for a job building scripter script . pipelineJob('test') { …
0
votes
0 answers

One click build

Could anyone please help the steps I need to follow Problem statement: create a dashboard in newrelic to consolidate the build job metrics running on Jenkins Note: eg: when we trigger one click build the all the Jenkins job metrics should show in…
0
votes
1 answer

Build a Jenkins job that triggers all of our other jobs with the parameters of the successful builds

I have a small change that I need to push, that affect all of our 60 jobs (Jenkinsfiles). I want to test first each job (at integration) with that change. In order to do that efficiently I was thinking to build a new job that triggers all those 60…
0
votes
1 answer

Are build steps within a Jenkins Job sequential or parallel?

I am trying to figure out if within a specific Jenkins Freestyle job the build steps are executed in parallel or sequentially. I am using Jenkins to schedule some batch files, but I have some dependencies between the tables generated from one to…
Tim s
  • 1
0
votes
1 answer

Multijob in Jenkins Job Builder

This is my first post here. I am a newbie in YAML and a beginners in Jenkins. I have a requirement where I have to create a multijob project using Jenkins Job builders where project names I want to store as a variable. so the intention is explained…
0
votes
1 answer

With Jenkins Job Builder (JJB) is it possible to provide generic parameter defaults for re-used parameters?

I have a JJB project where I want to re-use parameter definitions by referencing them (see doc). In general this works: - defaults: name: "some-defaults" param_1: string: name: PARAM1 default: "some default value" -…
frans
  • 8,868
  • 11
  • 58
  • 132
0
votes
1 answer

With JJB (Jenkins Job Builder) is it possible to set environment variables without making them a job parameter?

I'd like to set a bunch of variables to be used inside JJB-created pipeline-scm job scripts, e.g. details about CI infrastructure. It's possible to set those variables using parameters: - job: name: "some-job" project-type: pipeline …
frans
  • 8,868
  • 11
  • 58
  • 132
0
votes
1 answer

I want to know python build in parallel (Jenkins)

Now I'm building using execute shell in Jenkins. (currently) The code below is built in order. I want to implement this in parallel. now code status (I want) build action -> test1.py ~ test4.py executed in parallel Is there a way to build in…
0
votes
1 answer

Is there a way to add a parameter to all the Jenkin jobs I have access to?

I am trying to add a parameter called timeout in all my Jenkin jobs.
0
votes
1 answer

Problem with passing parameters to Jenkins build using Jenkins Job Builder

I want to pass custom parameters to my Jenkins builds using Jenkins Job Builder. My current job definition YAML file and configuration file look like this: deploy.yaml - job: name: 'TestJobName' display-name: 'TestJobName' description:…
0
votes
2 answers

Jenkins pipeline stages with conditions

Can I use "jenkins job builder" and create pipeline job, which I could run only specific stages in? Something like this: pipeline: if (condition): stage1: //... if (condition): stage2: …
Kucharsky
  • 201
  • 3
  • 16
0
votes
1 answer

Build job in Jenkins through python script SSL connection

I want to build a job in jenkins through python script.I am totally new to python.I am using below method from python-jenkins.my jenkins url is https. server = jenkins.Jenkins(ci_jenkins_url, username=username, password=token) and i am getting…
0
votes
1 answer

Scripted Jenkinsfile parallel builders is not working

I'm attempting to use parallel builders in my scripted jenkinsfile. When I run the code jenkins is ignoring the node labels and just choosing the first available. What am I doing wrong? here is the code: node { withCredentials([ …
Mike W
  • 1