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 Method Summary collapse

Instance Method Details

#access_key_idObject



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

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

#check_appObject



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

def check_app
end

#check_authObject



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

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)


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

def needs_key?
  false
end

#only_create_app_versionObject



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

def only_create_app_version
  options[:only_create_app_version]
end

#push_appObject



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

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



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

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