kumo_dockercloud 2.1.0 → 2.2.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9506aa4ff5a6e5dc9775ba9cf36dc4ad5959bc4
|
4
|
+
data.tar.gz: 8848e236285eb1043ec39d20930b6f807573e369
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46f6600d38e3a32f976664d4ddd52e1d494e4b3c2323830f4c689f7c399dbdfa7b1bb16109f62823d106cf864d3c91d4d64b534b23ee8971e82112bd494a302c
|
7
|
+
data.tar.gz: 02b6be74db826142d5018825b7cacb97529d940ffe026bf1e4f002aef8083f9d24c619bda9e1ab10eeb529693183cf2f9d545543bf21321725c6554edd47ed1b
|
@@ -11,6 +11,7 @@ module KumoDockerCloud
|
|
11
11
|
key_string = key.to_s
|
12
12
|
parsed[key_string]['environment'] ||= {}
|
13
13
|
parsed[key_string]['environment'].merge!(converted_env_vars.fetch(key_string))
|
14
|
+
parsed[key_string]['environment'] = escape_characters_that_need_special_handling(parsed[key_string]['environment'])
|
14
15
|
end
|
15
16
|
|
16
17
|
parsed
|
@@ -20,6 +21,10 @@ module KumoDockerCloud
|
|
20
21
|
env_vars.keys.reduce({}) { |acc, key| acc[key.to_s] = env_vars[key]; acc }
|
21
22
|
end
|
22
23
|
|
24
|
+
def self.escape_characters_that_need_special_handling(env_hash)
|
25
|
+
env_hash.keys.reduce({}) { |acc, key| acc[key] = env_hash[key].gsub(/[$]{1}/, "$$"); acc }
|
26
|
+
end
|
27
|
+
|
23
28
|
private_class_method :make_all_root_level_keys_strings
|
24
29
|
end
|
25
30
|
end
|
@@ -43,6 +43,7 @@ describe KumoDockerCloud::StackFile do
|
|
43
43
|
TEST: thing
|
44
44
|
eos
|
45
45
|
end
|
46
|
+
|
46
47
|
it 'should add new secrets to the environment' do
|
47
48
|
expect(subject).to eq(app_name => {
|
48
49
|
'image' => 'a-thing',
|
@@ -52,6 +53,29 @@ describe KumoDockerCloud::StackFile do
|
|
52
53
|
}
|
53
54
|
})
|
54
55
|
end
|
56
|
+
|
57
|
+
context 'and environment variables that contain symbols that need special escaping' do
|
58
|
+
let(:stack_template) do
|
59
|
+
<<-eos
|
60
|
+
application-stack-name:
|
61
|
+
image: a-thing
|
62
|
+
environment:
|
63
|
+
TEST: 123$abc
|
64
|
+
eos
|
65
|
+
end
|
66
|
+
|
67
|
+
# to work around https://github.com/docker/dockercloud-cli/issues/17
|
68
|
+
it 'escapes environment variables that contain $ with an extra $' do
|
69
|
+
|
70
|
+
expect(subject).to eq(app_name => {
|
71
|
+
'image' => 'a-thing',
|
72
|
+
'environment' => {
|
73
|
+
'TEST' => '123$$abc',
|
74
|
+
'KEY' => 'VALUE'
|
75
|
+
}
|
76
|
+
})
|
77
|
+
end
|
78
|
+
end
|
55
79
|
end
|
56
80
|
|
57
81
|
context 'without any existing environment' do
|
@@ -61,6 +85,7 @@ describe KumoDockerCloud::StackFile do
|
|
61
85
|
image: a-thing
|
62
86
|
eos
|
63
87
|
end
|
88
|
+
|
64
89
|
it 'should create the environment with secrets in it' do
|
65
90
|
expect(subject).to eq(app_name => {
|
66
91
|
'image' => 'a-thing',
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kumo_dockercloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Redbubble
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-05-
|
13
|
+
date: 2016-05-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httpi
|