jellyfish_fog_aws 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/jellyfish_fog_aws.gemspec +1 -0
- data/lib/jellyfish_fog_aws.rb +7 -0
- data/lib/jellyfish_fog_aws/databases.rb +2 -5
- data/lib/jellyfish_fog_aws/infrastructure.rb +2 -6
- data/lib/jellyfish_fog_aws/storage.rb +2 -6
- data/lib/jellyfish_fog_aws/version.rb +1 -1
- data/spec/lib/jellyfish_fog_aws/databases_spec.rb +2 -3
- data/spec/lib/jellyfish_fog_aws/infrastructure_spec.rb +2 -3
- data/spec/lib/jellyfish_fog_aws/storage_spec.rb +2 -3
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09a10b75b4bd825a0ceb57221bd694a7628eb832
|
4
|
+
data.tar.gz: c572bac07c5dcac85841cda2763fcab36ba514e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 552f1ebef61b7f95975d0683363e70dc4da6e4075675510b3b5326d2973f103f3175006e5eae25cddf06f2212430ab9e2affe1b6fec610ed40f09d81ad827d2f
|
7
|
+
data.tar.gz: caee9f0f2a2616e3822db255ff384b1f9427c3dda141280f96356e1dece22796a3c97521340121729e451138875d86970b281d7d4664a218fced3771fdedb5c4
|
data/README.md
CHANGED
@@ -1 +1,5 @@
|
|
1
1
|
# JellyfishFogAws
|
2
|
+
|
3
|
+
[](https://codeclimate.com/repos/55253e7a6956801849003243/feed)
|
4
|
+
[](https://codeclimate.com/repos/55253e7a6956801849003243/feed)
|
5
|
+
[](https://travis-ci.org/projectjellyfish/jellyfish_fog_aws)
|
data/jellyfish_fog_aws.gemspec
CHANGED
data/lib/jellyfish_fog_aws.rb
CHANGED
@@ -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
|
@@ -36,9 +36,8 @@ module Jellyfish
|
|
36
36
|
|
37
37
|
def enable_aws_fog_provisioning
|
38
38
|
::Fog.mock!
|
39
|
-
|
40
|
-
|
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
|
-
|
29
|
-
|
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
|
-
|
30
|
-
|
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.
|
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-
|
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
|