Class: DPL::Provider::ElasticBeanstalk

Inherits:
DPL::Provider show all
Defined in:
lib/dpl/provider/elastic_beanstalk.rb

Constant Summary collapse

DEFAULT_REGION =
'us-east-1'

Instance Attribute Summary

Attributes inherited from DPL::Provider

#context, #options

Instance Method Summary collapse

Methods inherited from DPL::Provider

apt_get, #cleanup, #commit_msg, context, #create_key, #default_text_charset, #default_text_charset?, #deploy, deprecated, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup, #user_agent, #warn

Constructor Details

This class inherits a constructor from DPL::Provider

Instance Method Details

#access_key_idObject



17
18
19
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 17

def access_key_id
  options[:access_key_id] || context.env['AWS_ACCESS_KEY_ID'] || raise(Error, "missing access_key_id")
end

#check_appObject



33
34
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 33

def check_app
end

#check_authObject



25
26
27
28
29
30
31
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 25

def check_auth
  options = {
    :region      => region,
    :credentials => Aws::Credentials.new(access_key_id, secret_access_key)
  }
  Aws.config.update(options)
end

#needs_key?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 13

def needs_key?
  false
end

#only_create_app_versionObject



36
37
38
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 36

def only_create_app_version
  options[:only_create_app_version]
end

#push_appObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 40

def push_app
  @start_time = Time.now
  create_bucket unless bucket_exists?

  if options[:zip_file]
    zip_file = File.expand_path(options[:zip_file])
  else
    zip_file = create_zip
  end

  s3_object = upload(archive_name, zip_file)
  sleep 5 #s3 eventual consistency
  version = create_app_version(s3_object)
  if !only_create_app_version
    update_app(version)
    wait_until_deployed if options[:wait_until_deployed]
  end
end

#secret_access_keyObject



21
22
23
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 21

def secret_access_key
  options[:secret_access_key] || context.env['AWS_SECRET_ACCESS_KEY'] || raise(Error, "missing secret_access_key")
end