Module: Jujube::Components::Scm

Extended by:
Macros
Included in:
Jujube::Components
Defined in:
lib/jujube/components/scm.rb

Overview

Helper methods for creating SCM components.

store Pundle Specifications collapse

Instance Method Summary collapse

Methods included from Macros

attribute, section

Instance Method Details

#bundle(name) ⇒ Hash

Specify a bundle to check for a #store SCM.

Parameters:

  • name (String)

    The name of the bundle to check.

Returns:

  • (Hash)

    The specification for the package.



54
55
56
# File 'lib/jujube/components/scm.rb', line 54

def bundle(name)
  {"bundle" => name}
end

#git(options = {}) ⇒ Hash

Parameters:

  • options (Hash) (defaults to: {})

    The configuration options for the component.

Returns:

  • (Hash)

    The specification for the component.



15
# File 'lib/jujube/components/scm.rb', line 15

standard_component :git

#package(name) ⇒ Hash

Specify a package to check for a #store SCM.

Parameters:

  • name (String)

    The name of the package to check.

Returns:

  • (Hash)

    The specification for the package.



46
47
48
# File 'lib/jujube/components/scm.rb', line 46

def package(name)
  {"package" => name}
end

#store(options = {}) {|pundles| ... } ⇒ Hash

Specify a store SCM for a job.

See http://docs.openstack.org/infra/jenkins-job-builder/scm.html#scm.store.

store can watch multiple pundles (packages or bundles) The specification for each pundle is added in a nested configuration block using the #package or #bundle method.

Examples:

job "store-example" do |j|
  j.scm << store(script: "SCRIPT", repository: "REPO") do |pundles|
    pundles << package("PACKAGE")
    pundles << bundle("BUNDLE")
  end
end

Parameters:

  • options (Hash) (defaults to: {})

    Top-level options for configuring the component.

Yield Parameters:

  • pundles (Array)

    An array to which nested pundle specifications should be added by the block.

Returns:

  • (Hash)

    The specification for the component.



36
37
38
# File 'lib/jujube/components/scm.rb', line 36

def store(options = {}, &block)
  to_config("store", nested_options(:pundles, options, &block))
end