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, #deploy, #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



15
16
17
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 15

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

#check_appObject



27
28
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 27

def check_app
end

#check_authObject



23
24
25
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 23

def check_auth
  AWS.config(access_key_id: access_key_id, secret_access_key: secret_access_key, region: region)
end

#needs_key?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 11

def needs_key?
  false
end

#push_appObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 30

def push_app
  create_bucket unless bucket_exists?

  if options[:zip_file]
    zip_file = File.join(Dir.pwd, 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)
  update_app(version)
end

#secret_access_keyObject



19
20
21
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 19

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