class Gantree::DeployApplication
Attributes
options[RW]
Public Class Methods
new(name, options)
click to toggle source
# File lib/gantree/deploy_applications.rb, line 10 def initialize name, options @options = options @name = name puts "Found Application: #{@name}".green @environments = eb.describe_environments({ :application_name => @name })[:environments] end
Public Instance Methods
deploy_to_all()
click to toggle source
# 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?()
click to toggle source
# File lib/gantree/deploy_applications.rb, line 31 def environment_found? @environments.length >=1 ? true : false end
multiple_environments?()
click to toggle source
# File lib/gantree/deploy_applications.rb, line 27 def multiple_environments? @environments.length > 1 ? true : false end
run()
click to toggle source
# 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