Sha256: 3ff6e3aaff1461f033e3406df6b6d8b4f1f4f01765e58d648eb6efc376d3cd6f

Contents?: true

Size: 1.99 KB

Versions: 2

Compression:

Stored size: 1.99 KB

Contents

# frozen_string_literal: true

require_relative 'dsl/pipeline.rb'

module Rudder
  ##
  # DSL for configuring and manipulating Concourse Pipelines
  #
  # The building blocks of the DSL are:
  # - {Rudder::DSL::Pipeline}, the top level definition containg all other definitions.
  #   See {https://concourse-ci.org/pipelines.html Concourse Pipeline}
  # - {Rudder::DSL::Resource}, representing inputs and outputs of jobs.
  #   See {https://concourse-ci.org/resources.html Concourse Resource}
  # - {Rudder::DSL::Job}, units of work.
  #   See {https://concourse-ci.org/jobs.html Concourse Job}
  # - {Rudder::DSL::ResourceType}, defines how a {Rudder::DSL::Resource} operates.
  #   See {https://concourse-ci.org/resource-types.html Concourse Resource Type}
  # - {Rudder::DSL::Group}, logically groups together Concourse Jobs in the UI.
  #   See {https://concourse-ci.org/pipeline-groups.html Concourse Grouping Jobs}
  #
  module DSL
    ##
    # Entry to the DSL. Creates a new pipeline
    # instance to evaluate user defined pipelines
    #
    # @return [Rudder::DSL::Pipeline] new, and unevaluated
    #
    def self.pipeline(*args, **kwargs)
      Rudder::DSL::Pipeline.new(*args, **kwargs)
    end

    ##
    # Load a pipeline from a definition file
    # at the +path+
    #
    # @param path [String] to the {Rudder::DSL::Pipeline} definition
    # @param vars optional [Hash<(Symbol, String), Any>] of +Concourse+ variables
    # @return [Rudder::DSL::Pipeline] from +path+, unevaluated
    #
    def self.from_file(path, vars: {})
      Rudder::DSL::Pipeline.new path, vars: vars
    end

    ##
    # Load and evaluate a pipeline from a definition file
    # at the +path+
    #
    # @param path [String] to the {Rudder::DSL::Pipeline} definition
    # @param vars optional [Hash<(Symbol, String), Any>] of +Concourse+ variables
    # @return [Rudder::DSL::Pipeline] from +path+, fully evaluated
    #
    def self.eval_from_file(path, vars: {})
      Rudder::DSL::Pipeline.new(path, vars: vars).eval
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rudder-0.3.1 lib/rudder/dsl.rb
rudder-0.3.0 lib/rudder/dsl.rb