Module: Rudder

Defined in:
lib/rudder.rb,
lib/rudder/dsl.rb,
lib/rudder/dsl/job.rb,
lib/rudder/version.rb,
lib/rudder/dsl/util.rb,
lib/rudder/dsl/group.rb,
lib/rudder/dsl/pipeline.rb,
lib/rudder/dsl/resource.rb,
lib/rudder/dsl/component.rb,
lib/rudder/dsl/resource_type.rb

Overview

Methods to compile Rudder definitions to Concourse Pipeline definitions

Defined Under Namespace

Modules: DSL

Constant Summary collapse

VERSION =
'0.3.1'

Class Method Summary collapse

Class Method Details

.compile(path, vars: {}) ⇒ Hash

Compiles a Rudder::DSL::Pipeline definition from path to a Hash

Parameters:

  • path (String)

    the path to the Rudder definition

  • vars

    optional [Hash<(Symbol, String), Any>] of Concourse variables

Returns:

  • (Hash)

    Concourse YAML friendly hash



21
22
23
# File 'lib/rudder.rb', line 21

def self.compile(path, vars: {})
  Rudder::DSL.eval_from_file(path, vars: vars).to_h
end

.dump(pipeline, output) ⇒ nil

Dumps a Rudder::DSL::Pipeline or Pipeline Hash to the provided file handle output

Parameters:

  • pipeline (Rudder::DSL::Pipeline)

    definition. Assumed to be evaluated.

  • output (File)

    handle to dump YAML to

Returns:

  • (nil)


33
34
35
# File 'lib/rudder.rb', line 33

def self.dump(pipeline, output)
  output.puts(YAML.dump(pipeline.to_h))
end