Git Product home page Git Product logo

chef-jenkins-job-builder's Introduction

jenkins-job-builder

The OpenStack jenkins-job-builder project provides a very useful tool that enables storing Jenkins job configuration as code.

This cookbook installs and configures jenkins-job-builder, as well as providing a build_jenkins_job definition which runs jenkins-job-builder against a given file or directory.

Dependencies

This cookbook depends on the opscode python cookbook for installation of jenkins-job-builder via pip. The jenkins-job-builder software will not be very useful to you without a Jenkins server to talk to.

Attributes

The following attributes are used for setting directory and file ownership

  • jenkins_job_builder.user
  • jenkins_job_builder.group

The following attributes are used to generate the config file in '/etc/jenkins_jobs'

  • jenkins_job_builder.username
  • jenkins_job_builder.password
  • jenkins_job_builder.url

Definition usage

Although this cookbook can be used stand-alone to simply install jenkins-job-builder, it is intended for use within an application or wrapper cookbook for automating the configuration of your Jenkins server.

For example, you may create your own examplecorp-jenkins-jobs cookbook with a recipe for the widget project:

include_recipe 'jenkins'
include_recipe 'jenkins_job_builder'

template '/opt/examplecorp-jenkins-jobs/widget.yaml' do
  # derp derp de derp
end

build_jenkins_job 'widget' do
  job_config '/opt/examplecorp-jenkins-jobs/widget.yaml'
end

This would effectively install the jenkins server, install jenkins-job-builder, create a jenkins-job-builder yaml file from template and update the Jenkins server configuration with that yaml file.

The build_jenkins_job definition accepts the following parameters:

  • job_config -- path to a file or directory that jenkins-job update should be run against (required)
  • config_path -- path to the config file that jenkins-job should be run with (defaults to '/etc/jenkins_jobs/jenkins_jobs.ini')
  • delete -- boolean which controls whether or not to delete the named job (defaults to false)

Caveats

Because jenkins-job-builder maintains its own internal cache representing the state of configured jobs, we depend on the accuracy of that cache for idempotency.

Just as with jenkins-job-builder itself, this cookbook assumes jobs will be managed only via jenkins-job-builder, all changes made via the web will be lost. You may wish to put a message to this effect in your jenkins job descriptions.

Changelog

chef-jenkins-job-builder's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.