bcome 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/objects/node/base.rb +7 -0
- data/lib/objects/node/meta_data_loader.rb +12 -5
- data/lib/objects/node/server/base.rb +4 -0
- data/lib/objects/ssh/driver.rb +15 -0
- data/lib/objects/terraform/state.rb +8 -2
- 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: 0e9ca596abfb2b5646f402dc387d0f5a2e4538d3
|
4
|
+
data.tar.gz: 360040b6babef02752da688aa45a9711879477fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cde41dc06bb6edfd02a30d5b497e77f9b0e8a723d57f58f8f982533e5e1a36c994374373b1cf777b6dbbfb2c05e35497130b6ea3dae20e0ed7c6a43de4cfcfa9
|
7
|
+
data.tar.gz: bfd7821e8a7a8085df798c3440aabf72fa351f10501c21a96044e200293411188e45ce3751765eac9cbbef8f2267fe8f6c9c5249608685dc2db0a134a7b78c7b
|
data/lib/objects/node/base.rb
CHANGED
@@ -87,6 +87,13 @@ module Bcome::Node
|
|
87
87
|
return
|
88
88
|
end
|
89
89
|
|
90
|
+
def put_from_string(string, remote_path)
|
91
|
+
resources.active.each do |resource|
|
92
|
+
resource.put_from_string(local_path, remote_path)
|
93
|
+
end
|
94
|
+
return
|
95
|
+
end
|
96
|
+
|
90
97
|
def execute_script(script_name)
|
91
98
|
results = {}
|
92
99
|
machines.pmap do |machine|
|
@@ -22,15 +22,22 @@ module Bcome::Node
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def terraform_data_for_namespace(namespace)
|
25
|
+
## TODO Not sure what was being smoked, but this only adds in data for the first module
|
26
|
+
## Until I can fix, we will:
|
27
|
+
|
25
28
|
parser = Bcome::Terraform::Parser.new(namespace)
|
26
29
|
attributes = parser.attributes
|
30
|
+
|
31
|
+
terraform_data = {}
|
32
|
+
|
27
33
|
if attributes.keys.any?
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
{}
|
34
|
+
## 1. Keep the old broken implementation
|
35
|
+
terraform_data["terraform_attributes"] = attributes if attributes.keys.any?
|
36
|
+
## 2. But make all the data accessible
|
37
|
+
terraform_data["tf_state"] = parser.state.config
|
33
38
|
end
|
39
|
+
|
40
|
+
terraform_data
|
34
41
|
end
|
35
42
|
|
36
43
|
def prompt_for_decryption_key
|
@@ -153,6 +153,10 @@ module Bcome::Node::Server
|
|
153
153
|
ssh_driver.put(local_path, remote_path)
|
154
154
|
end
|
155
155
|
|
156
|
+
def put_from_string(string, remote_path)
|
157
|
+
ssh_driver.put_from_string(string, remote_path)
|
158
|
+
end
|
159
|
+
|
156
160
|
def get(remote_path, local_path)
|
157
161
|
ssh_driver.get(remote_path, local_path)
|
158
162
|
end
|
data/lib/objects/ssh/driver.rb
CHANGED
@@ -231,6 +231,21 @@ module Bcome::Ssh
|
|
231
231
|
nil
|
232
232
|
end
|
233
233
|
|
234
|
+
def put_from_string(string, remote_path)
|
235
|
+
raise Bcome::Exception::MissingParamsForScp, "'put' requires a string and a remote_path" if string.to_s.empty? || remote_path.to_s.empty?
|
236
|
+
puts "\n(#{@context_node.namespace})\s".namespace + "Uploading from string to #{remote_path}\n".informational
|
237
|
+
|
238
|
+
begin
|
239
|
+
scp.upload!(StringIO.new(string), remote_path) do |_ch, name, sent, total|
|
240
|
+
puts "#{name}: #{sent}/#{total}".progress
|
241
|
+
end
|
242
|
+
rescue Exception => e # scp just throws generic exceptions :-/
|
243
|
+
puts e.message.error
|
244
|
+
end
|
245
|
+
nil
|
246
|
+
end
|
247
|
+
|
248
|
+
|
234
249
|
def get(remote_path, local_path)
|
235
250
|
raise Bcome::Exception::MissingParamsForScp, "'get' requires a local_path and a remote_path" if local_path.to_s.empty? || remote_path.to_s.empty?
|
236
251
|
puts "\n(#{@context_node.namespace})\s".namespace + "Downloading #{remote_path} to #{local_path}\n".informational
|
@@ -22,13 +22,19 @@ module Bcome::Terraform
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def config
|
25
|
-
|
25
|
+
return {} unless config_exists?
|
26
26
|
JSON.parse(File.read(config_path))
|
27
27
|
end
|
28
28
|
|
29
|
+
def modules
|
30
|
+
return {} unless config_exists?
|
31
|
+
return config["modules"]
|
32
|
+
end
|
33
|
+
|
29
34
|
def resources
|
35
|
+
# TODO What was I thinking ... We need all the modules...
|
30
36
|
return {} unless config_exists?
|
31
|
-
return
|
37
|
+
return modules[0]["resources"]
|
32
38
|
end
|
33
39
|
end
|
34
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bcome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Roderick (Webzakimbo)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|