Class: Bosh::Deployer::Cli::Commands::Deployment
- Inherits:
-
Object
- Object
- Bosh::Deployer::Cli::Commands::Deployment
- Defined in:
- lib/bosh-deployer/cli/commands/deployment.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #address ⇒ Object
- #filepath ⇒ Object
-
#initialize(name, filepath = nil) ⇒ Deployment
constructor
A new instance of Deployment.
- #target ⇒ Object
- #yml ⇒ Object
Constructor Details
#initialize(name, filepath = nil) ⇒ Deployment
Returns a new instance of Deployment.
7 8 9 10 |
# File 'lib/bosh-deployer/cli/commands/deployment.rb', line 7 def initialize(name, filepath=nil) @name = name @filepath = filepath end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/bosh-deployer/cli/commands/deployment.rb', line 5 def name @name end |
Instance Method Details
#address ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/bosh-deployer/cli/commands/deployment.rb', line 16 def address case name when 'microbosh' yml['address']['ip'] when 'bosh' yml['meta']['networks']['manual']['static'][0].split('-')[0].strip end end |
#filepath ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/bosh-deployer/cli/commands/deployment.rb', line 29 def filepath return @filepath if @filepath @filepath = case name when 'microbosh' '~/.microbosh/settings.yml' when 'bosh' '~/.deployer/stubs/bosh.yml' end end |
#target ⇒ Object
12 13 14 |
# File 'lib/bosh-deployer/cli/commands/deployment.rb', line 12 def target `bosh target #{address}` end |
#yml ⇒ Object
25 26 27 |
# File 'lib/bosh-deployer/cli/commands/deployment.rb', line 25 def yml YAML.load_file(filepath) end |