zergrush_cf 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +4 -2
- data/lib/zergrush_cf/renderer.rb +9 -4
- data/lib/zergrush_cf/version.rb +1 -1
- data/resources/option_schema.template +3 -0
- data/zergrush_cf.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODdlMmM0ODNkOTU5ZTE5MTNiMTBmZGM2Y2JiYzhjM2VkYTM2ZWM4OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjgwMWRlNDg0YmY2M2MxNzkzNDU5YzNlOWU3ZGU0MjUwZjc3MGQyNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGRmNjhlYzUyYTUwOWJkYjUxY2RjZTFhY2RlMjFjZmFlZTA0NDVkYzg1YWVl
|
10
|
+
NDJhYTQ0ZTQxODM4MjE3NWY4ODc2NzZhYWVmN2Q1NjA5ZTUxZGQzNjM2NzU5
|
11
|
+
MjM1YWVkNTI4MDZlZmJkNWU2ZmM4NzAzMzljNmNlYjdmOWNmMjE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzVjY2FlNDk1N2I1NDllZTFjY2M5MmFjYjc4MTUzMjdiMDVjNWQ2ZGVhM2E0
|
14
|
+
ZjRkYmRiODBiYTQ0MGI3ZDNjZTk4ZWI1M2EzNmExMTRkMjI1MjVjYTJjOGZj
|
15
|
+
MTFhMTg2Mjg3MGE1MjNmODU0YTg1ZTZiOTUzMzAwOWJlOTBjMTc=
|
data/README.md
CHANGED
@@ -13,8 +13,9 @@ Additional properties defined
|
|
13
13
|
|
14
14
|
- access_key_id - AWS access key id
|
15
15
|
- secret_access_key - AWS secret.
|
16
|
-
- template - body of a AWS CloudFormation template
|
17
|
-
-
|
16
|
+
- template - body of a AWS CloudFormation template (use this OR template_file)
|
17
|
+
- template_file - file containing the CloudFormation template. Path is relative to location of .ke task file in .hive (use this OR template)
|
18
|
+
- template_parameters - parameter values for the cloudformation template
|
18
19
|
|
19
20
|
Example use:
|
20
21
|
```
|
@@ -28,6 +29,7 @@ Example use:
|
|
28
29
|
"template": {
|
29
30
|
...
|
30
31
|
},
|
32
|
+
"template_file": "template_file.json",
|
31
33
|
"template_parameters": {
|
32
34
|
"Param1": "value",
|
33
35
|
"Param2": "ENV['SOME_VARIABLE']"
|
data/lib/zergrush_cf/renderer.rb
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
#++
|
23
23
|
|
24
24
|
require 'fileutils'
|
25
|
+
require 'json'
|
25
26
|
|
26
27
|
module ZergrushCF
|
27
28
|
class Renderer
|
@@ -30,6 +31,7 @@ module ZergrushCF
|
|
30
31
|
@vm = task_hash["vm"]
|
31
32
|
@name = task_name
|
32
33
|
@template = task_hash["vm"]["driver"]["driveroptions"][0]["template"]
|
34
|
+
@template_file = task_hash["vm"]["driver"]["driveroptions"][0]["template_file"]
|
33
35
|
@driver = task_hash["vm"]["driver"]["drivertype"]
|
34
36
|
@hive_location = hive_location
|
35
37
|
end
|
@@ -37,14 +39,17 @@ module ZergrushCF
|
|
37
39
|
def render
|
38
40
|
puts ("Rendering driver templates...")
|
39
41
|
|
40
|
-
|
41
|
-
abort("
|
42
|
+
abort("ERROR: Can't specify both template and template_file") unless @template == nil || @template_file == nil
|
43
|
+
abort("ERROR: Must specify template or template_file") unless @template != nil || @template_file != nil
|
44
|
+
|
45
|
+
template_body = (@template != nil) ? @template : JSON.parse( IO.read(File.join(@hive_location, @name, @template_file)) )
|
46
|
+
|
42
47
|
|
43
48
|
puts ("Writing #{File.join(@hive_location, "driver", @driver, @name, "template.json")}...")
|
44
49
|
FileUtils.mkdir_p(File.join(@hive_location, "driver", @driver, @name))
|
45
|
-
File.open(File.join("#{@hive_location}", "driver", @vm["driver"]["drivertype"], @name, "template.json"), 'w') { |file| file.write(
|
50
|
+
File.open(File.join("#{@hive_location}", "driver", @vm["driver"]["drivertype"], @name, "template.json"), 'w') { |file| file.write(template_body.to_json) }
|
46
51
|
|
47
|
-
return
|
52
|
+
return template_body
|
48
53
|
end
|
49
54
|
end
|
50
55
|
end
|
data/lib/zergrush_cf/version.rb
CHANGED
data/zergrush_cf.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
|
18
18
|
s.add_development_dependency "bundler", ">= 1.0.0"
|
19
19
|
s.add_development_dependency "rake"
|
20
|
-
s.add_development_dependency "zergrush", ">= 0.0.
|
20
|
+
s.add_development_dependency "zergrush", ">= 0.0.11"
|
21
21
|
|
22
22
|
s.add_dependency "fog", ">=1.20.0"
|
23
23
|
s.add_dependency "ruby-progressbar", "1.4.2"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zergrush_cf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MTN Satellite Communications
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.0.
|
47
|
+
version: 0.0.11
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.0.
|
54
|
+
version: 0.0.11
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: fog
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|