kumo_keisei 4.0.6 → 4.0.7
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 +6 -2
- data/VERSION +1 -1
- data/lib/kumo_keisei/stack.rb +5 -0
- data/spec/lib/kumo_keisei/stack_spec.rb +19 -1
- 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: dfd14b479ecbe73bb45fa4bb9c619a7dadef1d73
|
4
|
+
data.tar.gz: 7cddfcea3bef69d106eff3e2555e2af49b50cf24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbcbf96422f8e16ea0b668d6fb79621ee74b8ff9f59c00d0f5b8ad784a122a4417dce1817dc48b1ea42d0afbb472840deff2d98eeb70cfbb1daa8477c7919dec
|
7
|
+
data.tar.gz: adf2aece481994982d14972f1563ebf985054e4f53af4abc995ad6c502d8aaaea3f8e5f85f9efbea3764d83e9fcba51a9a7a9301785c407a5a6075b43d9b4625
|
data/README.md
CHANGED
@@ -96,7 +96,7 @@ stack_config = {
|
|
96
96
|
stack.apply!(stack_config)
|
97
97
|
```
|
98
98
|
|
99
|
-
### Getting the configuration without an `apply!`
|
99
|
+
### Getting the configuration and secrets without an `apply!`
|
100
100
|
|
101
101
|
If you need to inspect the configuration without applying a stack, call `config`:
|
102
102
|
```ruby
|
@@ -108,8 +108,12 @@ stack_config = {
|
|
108
108
|
}
|
109
109
|
}
|
110
110
|
marshalled_config = stack.config(stack_config)
|
111
|
-
|
111
|
+
marshalled_secrets = stack.plain_text_secrets(stack_config)
|
112
|
+
|
113
|
+
if marshalled_config['DB_HOST'].start_with? '192.' then
|
114
|
+
passwd = marshalled_secrets['DB_PASS']
|
112
115
|
...
|
116
|
+
end
|
113
117
|
```
|
114
118
|
|
115
119
|
## Upgrading from `KumoKeisei::CloudFormationStack` to `KumoKeisei::Stack`
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.0.
|
1
|
+
4.0.7
|
data/lib/kumo_keisei/stack.rb
CHANGED
@@ -82,6 +82,11 @@ module KumoKeisei
|
|
82
82
|
environment_config(stack_config).config
|
83
83
|
end
|
84
84
|
|
85
|
+
def plain_text_secrets(stack_config)
|
86
|
+
raise UsageError.new('You must provide a :config_path in the stack config hash to retrieve the stack\'s plain_text_secrets') unless stack_config.has_key?(:config_path)
|
87
|
+
environment_config(stack_config).plain_text_secrets
|
88
|
+
end
|
89
|
+
|
85
90
|
def params_template_path(stack_config)
|
86
91
|
stack_config.has_key?(:template_path) ? File.absolute_path(File.join(File.dirname(stack_config[:template_path]), "#{File.basename(stack_config[:template_path], '.*')}.yml.erb")) : nil
|
87
92
|
end
|
@@ -307,7 +307,6 @@ describe KumoKeisei::Stack do
|
|
307
307
|
expect { described_class.new(app_name, environment_name).config(stack_config)}.to raise_error(KumoKeisei::Stack::UsageError)
|
308
308
|
end
|
309
309
|
end
|
310
|
-
|
311
310
|
end
|
312
311
|
|
313
312
|
describe "#params_template_path" do
|
@@ -343,4 +342,23 @@ describe KumoKeisei::Stack do
|
|
343
342
|
|
344
343
|
end
|
345
344
|
|
345
|
+
describe "#plain_text_secrets" do
|
346
|
+
context "when passed a config_path and params_template_file_path" do
|
347
|
+
it "will return the results of the nested KumoKeisei::EnvironmentConfig.plain_text_secrets" do
|
348
|
+
expect(KumoKeisei::EnvironmentConfig).to receive(:new).with(stack_config.merge(params_template_file_path: "/#{stack_template_name}.yml.erb")).and_return(double(:environment_config, cf_params: {}, plain_text_secrets: { :foo=> 'bar', :baz=> 'qux' }))
|
349
|
+
expect(subject.plain_text_secrets(stack_config)).to eq({:foo=> 'bar', :baz=>'qux'})
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
context "if not given a stack_config containing a `config_path`" do
|
354
|
+
let(:stack_config) {
|
355
|
+
{
|
356
|
+
}
|
357
|
+
}
|
358
|
+
it "will raise an error" do
|
359
|
+
expect { described_class.new(app_name, environment_name).plain_text_secrets(stack_config)}.to raise_error(KumoKeisei::Stack::UsageError)
|
360
|
+
end
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
346
364
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kumo_keisei
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Redbubble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|