Class: Jujube::JobFileGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/jujube/job_file_generator.rb

Overview

Generate a YAML file suitable for jenkins-job-builder.

Instance Method Summary collapse

Instance Method Details

#generate(jobs, output) ⇒ Object

Generate a jenkins-job-builder YAML file for a list of jobs.

Parameters:

  • jobs (Array)

    The job definitions to include in the output.

  • output (Pathname)

    The output file to generate. Any intermediate directories are created automatically.



10
11
12
13
14
15
# File 'lib/jujube/job_file_generator.rb', line 10

def generate(jobs, output)
  output.dirname.mkpath
  output.open("w") do |io|
    jobs.map(&:to_h).to_yaml(io)
  end
end