Class: Gantree::DeployApplication
- Defined in:
- lib/gantree/deploy_applications.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Attributes inherited from Deploy
Instance Method Summary collapse
- #deploy_to_all ⇒ Object
- #environment_found? ⇒ Boolean
-
#initialize(name, options) ⇒ DeployApplication
constructor
A new instance of DeployApplication.
- #multiple_environments? ⇒ Boolean
- #run ⇒ Object
Methods inherited from Deploy
#application?, #check_dir_name, #check_eb_bucket, #create_eb_version, #deploy, #deploy_to_one, #environment?, #generate_eb_bucket, #prod_deploy?, #set_bucket, #update_application, #upload_to_s3
Methods inherited from Base
#authenticate_librato, #cfm, #check_credentials, check_for_updates, #check_template_bucket, #create_default_env, #eb, #env_type, #error_msg, #escape_characters_in_string, #get_latest_docker_solution, #print_options, #s3, #set_aws_keys, #tag, update_configuration, #upload_templates
Constructor Details
#initialize(name, options) ⇒ DeployApplication
Returns a new instance of DeployApplication.
10 11 12 13 14 15 |
# File 'lib/gantree/deploy_applications.rb', line 10 def initialize name, @options = @name = name puts "Found Application: #{@name}".green @environments = eb.describe_environments({ :application_name => @name })[:environments] end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/gantree/deploy_applications.rb', line 8 def @options end |
Instance Method Details
#deploy_to_all ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/gantree/deploy_applications.rb', line 35 def deploy_to_all puts "WARN: Deploying to All Environments in the Application: #{@name}".yellow sleep 3 envs = [] @environments.each do |env| envs << env[:environment_name] end puts "envs: #{envs}" deploy(envs) end |
#environment_found? ⇒ Boolean
31 32 33 |
# File 'lib/gantree/deploy_applications.rb', line 31 def environment_found? @environments.length >=1 ? true : false end |
#multiple_environments? ⇒ Boolean
27 28 29 |
# File 'lib/gantree/deploy_applications.rb', line 27 def multiple_environments? @environments.length > 1 ? true : false end |
#run ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/gantree/deploy_applications.rb', line 17 def run if multiple_environments? deploy_to_all elsif environment_found? deploy_to_one else error_msg "ERROR: There are no environments in this application" end end |