Class: Bosh::AwsCliPlugin::BoshBootstrap
- Defined in:
- lib/bosh_cli_plugin_aws/bosh_bootstrap.rb
Constant Summary
Constants inherited from Bootstrap
Bosh::AwsCliPlugin::Bootstrap::AWS_JENKINS_BUCKET
Instance Attribute Summary collapse
-
#director ⇒ Object
Returns the value of attribute director.
-
#s3 ⇒ Object
Returns the value of attribute s3.
Attributes inherited from Bootstrap
Instance Method Summary collapse
-
#initialize(director, s3, options) ⇒ BoshBootstrap
constructor
A new instance of BoshBootstrap.
- #start ⇒ Object
- #validate_requirements ⇒ Object
Methods inherited from Bootstrap
Constructor Details
#initialize(director, s3, options) ⇒ BoshBootstrap
Returns a new instance of BoshBootstrap.
14 15 16 17 18 19 20 |
# File 'lib/bosh_cli_plugin_aws/bosh_bootstrap.rb', line 14 def initialize(director, s3, ) self. = self.[:non_interactive] = true self.director = director self.s3 = s3 @env = ENV.to_hash end |
Instance Attribute Details
#director ⇒ Object
Returns the value of attribute director.
12 13 14 |
# File 'lib/bosh_cli_plugin_aws/bosh_bootstrap.rb', line 12 def director @director end |
#s3 ⇒ Object
Returns the value of attribute s3.
12 13 14 |
# File 'lib/bosh_cli_plugin_aws/bosh_bootstrap.rb', line 12 def s3 @s3 end |
Instance Method Details
#start ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/bosh_cli_plugin_aws/bosh_bootstrap.rb', line 38 def start release_exist, first_stemcell = validate_requirements fetch_and_upload_release unless release_exist if first_stemcell manifest.stemcell_name = first_stemcell['name'] else manifest.stemcell_name = Bosh::Stemcell::Archive.new(fetch_and_upload_stemcell).name end generate_manifest deploy target_bosh_and_log_in end |
#validate_requirements ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/bosh_cli_plugin_aws/bosh_bootstrap.rb', line 22 def validate_requirements release_exist = director.list_releases.detect { |r| r['name'] == 'bosh' } first_stemcell = director.list_stemcells.first existing_deployments = director.list_deployments.map { |deployment| deployment['name'] } if existing_deployments.include? manifest.bosh_deployment_name raise BootstrapError, <<-MSG Deployment '#{manifest.bosh_deployment_name}' already exists. This command should be used for bootstrapping bosh from scratch. MSG end return release_exist, first_stemcell end |