class Deploy::Eb::Platform
Public Class Methods
configured?()
click to toggle source
# File lib/deploy/eb/platform.rb, line 6 def self.configured? Open3.popen3("eb list") { |_input, _output, _error, thread| thread.value }.exitstatus == 0 end
new(opts)
click to toggle source
# File lib/deploy/eb/platform.rb, line 12 def initialize(opts) @eb = opts[:eb] @tag = opts[:tag] end
Public Instance Methods
deploy!()
click to toggle source
# File lib/deploy/eb/platform.rb, line 17 def deploy! fail "Environment NOT READY!" unless @eb.ready? fail "Environment switch failed." unless @eb.switch eb_deploy! end
Private Instance Methods
eb_deploy!()
click to toggle source
# File lib/deploy/eb/platform.rb, line 31 def eb_deploy! if @eb.version_exists?(@tag) write_redeploy_notification system("eb deploy --version=#{@tag}") else system("eb deploy --label=#{@tag}") end end
write_redeploy_notification()
click to toggle source
# File lib/deploy/eb/platform.rb, line 25 def write_redeploy_notification puts "Elastic Beanstalk application #{@eb.application_name}"\ " already has version #{@tag}" puts "Assuming you do mean to redeploy, perhaps to a new target." end