opsicle 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opsicle/client.rb +3 -2
- data/lib/opsicle/config.rb +6 -1
- data/lib/opsicle/version.rb +1 -1
- data/spec/opsicle/client_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4cc47663adbf7d7079db60f9dd4fd55c58c5f7d
|
4
|
+
data.tar.gz: cf583de4cb67fe7f9b291185c9bc070ca7af325e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faa539c5e2238a4107c4d80774c083bbe02be70e4e3c459c9d0114d60ff1c4add9f61711429055e54d59272447853e4c3dfddf6cbeb665218b96518029029251
|
7
|
+
data.tar.gz: 5fcb498e1cf36b97413e95ed306e65812c77406d34709f6203347b9042a6d461965456a947f461b0249cd4589f0822ce952a52544af401ec7cf99ba5b3c6df91
|
data/lib/opsicle/client.rb
CHANGED
@@ -10,8 +10,9 @@ module Opsicle
|
|
10
10
|
@config = Config.instance
|
11
11
|
@config.configure_aws_environment!(environment)
|
12
12
|
credentials = @config.aws_credentials
|
13
|
-
|
14
|
-
@
|
13
|
+
region = @config.opsworks_region
|
14
|
+
@opsworks = Aws::OpsWorks::Client.new(region: region, credentials: credentials)
|
15
|
+
@s3 = Aws::S3::Client.new(region: region, credentials: credentials)
|
15
16
|
end
|
16
17
|
|
17
18
|
def run_command(command, command_args={}, options={})
|
data/lib/opsicle/config.rb
CHANGED
@@ -20,6 +20,10 @@ module Opsicle
|
|
20
20
|
@opsworks_config ||= load_config(OPSICLE_CONFIG_PATH)
|
21
21
|
end
|
22
22
|
|
23
|
+
def opsworks_region
|
24
|
+
opsworks_config[:region] || "us-east-1"
|
25
|
+
end
|
26
|
+
|
23
27
|
def configure_aws_environment!(environment)
|
24
28
|
@environment = environment.to_sym
|
25
29
|
end
|
@@ -57,12 +61,13 @@ module Opsicle
|
|
57
61
|
def authenticate_with_credentials
|
58
62
|
profile_name = opsworks_config[:profile_name] || @environment.to_s
|
59
63
|
credentials = Aws::SharedCredentials.new(profile_name: profile_name)
|
64
|
+
region = opsworks_region
|
60
65
|
|
61
66
|
unless credentials.set?
|
62
67
|
abort('Opsicle can no longer authenticate through your ~/.fog file. Please run `opsicle legacy-credential-converter` before proceeding.')
|
63
68
|
end
|
64
69
|
|
65
|
-
Aws.config.update({region:
|
70
|
+
Aws.config.update({region: region, credentials: credentials})
|
66
71
|
|
67
72
|
iam = Aws::IAM::Client.new
|
68
73
|
|
data/lib/opsicle/version.rb
CHANGED
data/spec/opsicle/client_spec.rb
CHANGED
@@ -10,6 +10,7 @@ module Opsicle
|
|
10
10
|
mock_keys = {access_key_id: 'key', secret_access_key: 'secret'}
|
11
11
|
allow(config).to receive(:aws_credentials).and_return(mock_keys)
|
12
12
|
allow(config).to receive(:opsworks_config).and_return({ stack_id: 'stack', app_id: 'app', something_else: 'true' })
|
13
|
+
allow(config).to receive(:opsworks_region).and_return('us-east-1')
|
13
14
|
allow(Config).to receive(:new).and_return(config)
|
14
15
|
allow(Config).to receive(:instance).and_return(config)
|
15
16
|
allow(Aws::OpsWorks::Client).to receive(:new).and_return(aws_client)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opsicle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Fleener
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|