Class: Bosh::Deployer::Stemcell
- Inherits:
-
Object
- Object
- Bosh::Deployer::Stemcell
- Defined in:
- lib/bosh-deployer/stemcell.rb
Instance Attribute Summary collapse
-
#default_path ⇒ Object
readonly
Returns the value of attribute default_path.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #download ⇒ Object
-
#initialize(name, version, default_path = '~/.deployer/stemcells') ⇒ Stemcell
constructor
A new instance of Stemcell.
- #tar_filename ⇒ Object
- #upload ⇒ Object
Constructor Details
#initialize(name, version, default_path = '~/.deployer/stemcells') ⇒ Stemcell
5 6 7 8 9 |
# File 'lib/bosh-deployer/stemcell.rb', line 5 def initialize(name, version, default_path = '~/.deployer/stemcells') @name = name @version = version @default_path = default_path end |
Instance Attribute Details
#default_path ⇒ Object (readonly)
Returns the value of attribute default_path.
4 5 6 |
# File 'lib/bosh-deployer/stemcell.rb', line 4 def default_path @default_path end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/bosh-deployer/stemcell.rb', line 4 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
4 5 6 |
# File 'lib/bosh-deployer/stemcell.rb', line 4 def version @version end |
Instance Method Details
#download ⇒ Object
11 12 13 |
# File 'lib/bosh-deployer/stemcell.rb', line 11 def download system("wget --timeout=10 -q #{url} -P #{default_path}") end |
#tar_filename ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/bosh-deployer/stemcell.rb', line 18 def tar_filename if os != 'centos' "bosh-stemcell-#{version}-#{cloud}-#{virtualization_type}-#{os}-#{os_version}-go_agent.tgz" else "bosh-stemcell-#{version}-#{cloud}-#{virtualization_type}-#{os}-go_agent.tgz" end end |
#upload ⇒ Object
14 15 16 |
# File 'lib/bosh-deployer/stemcell.rb', line 14 def upload system("bosh upload stemcell #{default_path}/#{tar_filename}") end |