jellyfish_fog_aws 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5f3b13c34146016b173ae461f482be015df6be8
4
- data.tar.gz: b53c0d6215c0879a8e0c09f0204c648df05edec2
3
+ metadata.gz: 09a10b75b4bd825a0ceb57221bd694a7628eb832
4
+ data.tar.gz: c572bac07c5dcac85841cda2763fcab36ba514e0
5
5
  SHA512:
6
- metadata.gz: 6d66bab015860a82a6bf4e6a2ced4917ddaeeb120bb64c5a582b47a2a3312da297f9d85971747b8655792341ba7f07f3447e6ea662c35d85154be9c6e54e898d
7
- data.tar.gz: a1618a065f911111b07da92e797e6b8661175dea58fd179e901c1c882d3b2e3692fa4c7c744ac2b0bb58f8f92b7f7b43a2134631a2c2337213752b26b0385f8b
6
+ metadata.gz: 552f1ebef61b7f95975d0683363e70dc4da6e4075675510b3b5326d2973f103f3175006e5eae25cddf06f2212430ab9e2affe1b6fec610ed40f09d81ad827d2f
7
+ data.tar.gz: caee9f0f2a2616e3822db255ff384b1f9427c3dda141280f96356e1dece22796a3c97521340121729e451138875d86970b281d7d4664a218fced3771fdedb5c4
data/README.md CHANGED
@@ -1 +1,5 @@
1
1
  # JellyfishFogAws
2
+
3
+ [![Code Climate](https://codeclimate.com/repos/55253e7a6956801849003243/badges/a47db528fb1b7843dec4/gpa.svg)](https://codeclimate.com/repos/55253e7a6956801849003243/feed)
4
+ [![Test Coverage](https://codeclimate.com/repos/55253e7a6956801849003243/badges/a47db528fb1b7843dec4/coverage.svg)](https://codeclimate.com/repos/55253e7a6956801849003243/feed)
5
+ [![Build Status](https://api.travis-ci.org/projectjellyfish/jellyfish_fog_aws.svg)](https://travis-ci.org/projectjellyfish/jellyfish_fog_aws)
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.add_dependency 'rails'
19
19
  s.add_dependency 'fog'
20
20
  s.add_dependency 'bcrypt'
21
+ s.add_dependency 'jellyfish-provisioner'
21
22
 
22
23
  s.add_development_dependency 'sqlite3'
23
24
  s.add_development_dependency 'rspec-rails'
@@ -1,5 +1,6 @@
1
1
  require 'fog'
2
2
  require 'bcrypt'
3
+ require 'jellyfish/provisioner'
3
4
  require 'jellyfish_fog_aws/engine'
4
5
  require 'jellyfish_fog_aws/databases'
5
6
  require 'jellyfish_fog_aws/storage'
@@ -8,6 +9,12 @@ require 'jellyfish_fog_aws/infrastructure'
8
9
  module Jellyfish
9
10
  module Fog
10
11
  module AWS
12
+ def self.aws_settings
13
+ {
14
+ aws_access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
15
+ aws_secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY')
16
+ }
17
+ end
11
18
  end
12
19
  end
13
20
  end
@@ -3,7 +3,7 @@ require 'bcrypt'
3
3
  module Jellyfish
4
4
  module Fog
5
5
  module AWS
6
- class Databases < ::Provisioner
6
+ class Databases < Jellyfish::Provisioner
7
7
  def provision
8
8
  @password = SecureRandom.hex(5)
9
9
  db_instance_id = "id-#{@order_item.uuid[0..9]}"
@@ -31,10 +31,7 @@ module Jellyfish
31
31
  end
32
32
 
33
33
  def connection
34
- ::Fog::AWS::RDS.new(
35
- aws_access_key_id: aws_settings.fetch(:access_key),
36
- aws_secret_access_key: aws_settings.fetch(:secret_key)
37
- )
34
+ ::Fog::AWS::RDS.new(Jellyfish::Fog::AWS.aws_settings)
38
35
  end
39
36
 
40
37
  def identifier
@@ -1,7 +1,7 @@
1
1
  module Jellyfish
2
2
  module Fog
3
3
  module AWS
4
- class Infrastructure < ::Provisioner
4
+ class Infrastructure < Jellyfish::Provisioner
5
5
  def provision
6
6
  # TODO: Must get an image_id from product
7
7
  details = { 'image_id' => 'ami-acca47c4' }
@@ -25,11 +25,7 @@ module Jellyfish
25
25
  private
26
26
 
27
27
  def connection
28
- ::Fog::Compute.new(
29
- provider: 'AWS',
30
- aws_access_key_id: aws_settings.fetch(:access_key),
31
- aws_secret_access_key: aws_settings.fetch(:secret_key)
32
- )
28
+ ::Fog::Compute.new(Jellyfish::Fog::AWS.aws_settings.merge(provider: 'AWS'))
33
29
  end
34
30
 
35
31
  def server_identifier
@@ -1,7 +1,7 @@
1
1
  module Jellyfish
2
2
  module Fog
3
3
  module AWS
4
- class Storage < ::Provisioner
4
+ class Storage < Jellyfish::Provisioner
5
5
  def provision
6
6
  instance_name = "id-#{order_item.uuid[0..9]}"
7
7
  begin
@@ -24,11 +24,7 @@ module Jellyfish
24
24
  private
25
25
 
26
26
  def connection
27
- ::Fog::Storage.new(
28
- provider: 'AWS',
29
- aws_access_key_id: aws_settings.fetch(:access_key),
30
- aws_secret_access_key: aws_settings.fetch(:secret_key)
31
- )
27
+ ::Fog::Storage.new(Jellyfish::Fog::AWS.aws_settings.merge(provider: 'AWS'))
32
28
  end
33
29
 
34
30
  def storage_key
@@ -1,7 +1,7 @@
1
1
  module Jellyfish
2
2
  module Fog
3
3
  module AWS
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
6
6
  end
7
7
  end
@@ -36,9 +36,8 @@ module Jellyfish
36
36
 
37
37
  def enable_aws_fog_provisioning
38
38
  ::Fog.mock!
39
- allow_any_instance_of(::Provisioner).to receive(:aws_settings).and_return(
40
- access_key: 'text', secret_key: 'text'
41
- )
39
+ allow(ENV).to receive(:fetch).with('AWS_ACCESS_KEY_ID').and_return('text')
40
+ allow(ENV).to receive(:fetch).with('AWS_SECRET_ACCESS_KEY').and_return('text')
42
41
  end
43
42
  end
44
43
  end
@@ -25,9 +25,8 @@ module Jellyfish
25
25
 
26
26
  def enable_aws_fog_provisioning
27
27
  ::Fog.mock!
28
- allow_any_instance_of(::Provisioner).to receive(:aws_settings).and_return(
29
- access_key: 'text', secret_key: 'text'
30
- )
28
+ allow(ENV).to receive(:fetch).with('AWS_ACCESS_KEY_ID').and_return('text')
29
+ allow(ENV).to receive(:fetch).with('AWS_SECRET_ACCESS_KEY').and_return('text')
31
30
  end
32
31
  end
33
32
  end
@@ -26,9 +26,8 @@ module Jellyfish
26
26
 
27
27
  def enable_aws_fog_provisioning
28
28
  ::Fog.mock!
29
- allow_any_instance_of(::Provisioner).to receive(:aws_settings).and_return(
30
- access_key: 'access key id', secret_key: 'secret access key'
31
- )
29
+ allow(ENV).to receive(:fetch).with('AWS_ACCESS_KEY_ID').and_return('text')
30
+ allow(ENV).to receive(:fetch).with('AWS_SECRET_ACCESS_KEY').and_return('text')
32
31
  end
33
32
  end
34
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jellyfish_fog_aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-07 00:00:00.000000000 Z
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: jellyfish-provisioner
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: sqlite3
57
71
  requirement: !ruby/object:Gem::Requirement