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



29
30
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 29

def check_app
end

#check_authObject



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

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)


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

def needs_key?
  false
end

#only_create_app_versionObject



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

def only_create_app_version
  options[:only_create_app_version]
end

#push_appObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/dpl/provider/elastic_beanstalk.rb', line 36

def push_app
  @start_time = Time.now
  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)
  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