Module: Bosh::Deployer::Helpers

Included in:
Cli::Command::Micro, Config, InstanceManager, InstanceManager
Defined in:
lib/deployer/helpers.rb

Constant Summary collapse

DEPLOYMENTS_FILE =
"bosh-deployments.yml"

Instance Method Summary collapse

Instance Method Details

#cloud_plugin(config) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/deployer/helpers.rb', line 13

def cloud_plugin(config)
  if config["cloud"].nil?
    raise ConfigError, "No cloud properties defined"
  end
  if config["cloud"]["plugin"].nil?
    raise ConfigError, "No cloud plugin defined"
  end

  config["cloud"]["plugin"]
end

#dig_hash(hash, *path) ⇒ Object



24
25
26
27
28
# File 'lib/deployer/helpers.rb', line 24

def dig_hash(hash, *path)
  path.inject(hash) do |location, key|
    location.respond_to?(:keys) ? location[key] : nil
  end
end

#is_tgz?(path) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/deployer/helpers.rb', line 9

def is_tgz?(path)
  File.extname(path) == ".tgz"
end