zergrush 0.0.2 → 0.0.4

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: 844bb8bd048291c52f73b059cf340e77bed04a10
4
- data.tar.gz: 8f0f0fcc66cf2f8b343069e5584bb06f8a2c1094
3
+ metadata.gz: 1d8acedf70be7adb1d251ac32a9aaf0549b4cf8a
4
+ data.tar.gz: 8a409859068d49143531054b27eae205151c6395
5
5
  SHA512:
6
- metadata.gz: 93e4655161b2f76b6d4ed89c36c31cf25c1be5dcb62eae005adc66cff9ec69530a81cd5db3bb0746ea175c975ece829fe1948b8b414663ce257020d7dc1044dd
7
- data.tar.gz: 9c936ece2eb8ae857e74c32dc402c1396430311873cd4c7a8673e9a0add222716a9872a942c8909bf7fb64afaa7cddd28b68cc9ae0e65ee2ec7a59a147b780f3
6
+ metadata.gz: c717e03ced04167092686320a8c0962c204201ba29119ce3fbe86547344dcab4e83a424297ce9385f932e6d223553127d739a032396b8ec8ab61fbaf4cb24c76
7
+ data.tar.gz: 853a2d5f031e6f71c9b733c92459002c903de927b22f6226fd180d84e65fb521e1170508e0bb453bec02e1dc0207eb8593a32fa5fce761da3314d454b69e47e0
data/Gemfile.lock CHANGED
@@ -1,11 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zergrush (0.0.2)
4
+ zergrush (0.0.3)
5
5
  awesome_print
6
6
  highline
7
7
  json-schema
8
8
  thor
9
+ zergrush_vagrant
9
10
 
10
11
  GEM
11
12
  remote: https://rubygems.org/
@@ -25,13 +26,30 @@ GEM
25
26
  multi_json (>= 1.7.5, < 2.0)
26
27
  multi_test (>= 0.0.2)
27
28
  diff-lcs (1.2.5)
29
+ excon (0.28.0)
28
30
  ffi (1.9.3)
31
+ fog (1.18.0)
32
+ builder
33
+ excon (~> 0.28.0)
34
+ formatador (~> 0.2.0)
35
+ mime-types
36
+ multi_json (~> 1.0)
37
+ net-scp (~> 1.1)
38
+ net-ssh (>= 2.1.3)
39
+ nokogiri (~> 1.5)
40
+ ruby-hmac
41
+ formatador (0.2.4)
29
42
  gherkin (2.12.2)
30
43
  multi_json (~> 1.3)
31
44
  highline (1.6.20)
32
- json-schema (2.1.3)
45
+ json-schema (2.2.1)
46
+ mime-types (2.0)
33
47
  multi_json (1.8.4)
34
48
  multi_test (0.0.3)
49
+ net-scp (1.1.2)
50
+ net-ssh (>= 2.6.5)
51
+ net-ssh (2.7.0)
52
+ nokogiri (1.5.11)
35
53
  rake (10.1.1)
36
54
  rspec (2.14.1)
37
55
  rspec-core (~> 2.14.0)
@@ -41,7 +59,20 @@ GEM
41
59
  rspec-expectations (2.14.4)
42
60
  diff-lcs (>= 1.1.3, < 2.0)
43
61
  rspec-mocks (2.14.4)
62
+ ruby-hmac (0.4.0)
63
+ ruby-libvirt (0.4.0)
44
64
  thor (0.18.1)
65
+ vagrant-aws (0.4.1)
66
+ fog (~> 1.18.0)
67
+ vagrant-libvirt (0.0.15)
68
+ fog (~> 1.15)
69
+ nokogiri (~> 1.5.9)
70
+ ruby-libvirt (~> 0.4.0)
71
+ vagrant-omnibus (1.2.1)
72
+ zergrush_vagrant (0.0.1)
73
+ vagrant-aws
74
+ vagrant-libvirt
75
+ vagrant-omnibus
45
76
 
46
77
  PLATFORMS
47
78
  ruby
data/data/ke.schema CHANGED
@@ -1,33 +1,26 @@
1
1
  {
2
2
  "type": "object",
3
- "id": "com.mtnsat.zerg.json.ke",
4
3
  "properties": {
5
4
  "instances": {
6
5
  "type": "integer",
7
- "id": "com.mtnsat.zerg.json.ke.instances",
8
6
  "minimum": 0
9
7
  },
10
8
  "ram_per_vm": {
11
9
  "type": "integer",
12
- "id": "com.mtnsat.zerg.json.ke.ram_per_vm",
13
10
  "minimum": 256
14
11
  },
15
12
  "synced_folders": {
16
13
  "type": "array",
17
- "id": "com.mtnsat.zerg.json.ke.tasks",
18
14
  "items": {
19
15
  "properties": {
20
16
  "host_path": {
21
- "type": "string",
22
- "id": "com.mtnsat.zerg.json.ke.synced_folder.item.host_path"
17
+ "type": "string"
23
18
  },
24
19
  "guest_path": {
25
- "type": "string",
26
- "id": "com.mtnsat.zerg.json.ke.synced_folder.item.guest_path"
20
+ "type": "string"
27
21
  },
28
22
  "options": {
29
- "type": "array",
30
- "id": "com.mtnsat.zerg.json.ke.synced_folder.item.options"
23
+ "type": "array"
31
24
  }
32
25
  },
33
26
  "required": [
@@ -39,253 +32,25 @@
39
32
  },
40
33
  "tasks": {
41
34
  "type": "array",
42
- "id": "com.mtnsat.zerg.json.ke.tasks",
43
35
  "minItems": 1,
44
36
  "items": {
45
- "properties": {
46
- "type": {
47
- "type": "string",
48
- "pattern": "^(shell|chef_client|chef_solo)$",
49
- "id": "com.mtnsat.zerg.json.ke.tasks.item.type"
50
- },
51
- "inline": {
52
- "type": "string",
53
- "id": "com.mtnsat.zerg.json.ke.tasks.item.inline"
54
- },
55
- "path": {
56
- "type": "string",
57
- "id": "com.mtnsat.zerg.json.ke.tasks.item.path"
58
- },
59
- "parameters": {
60
- "type": "string",
61
- "id": "com.mtnsat.zerg.json.ke.tasks.item.parameters"
62
- },
63
- "environment": {
64
- "type": "string",
65
- "id": "com.mtnsat.zerg.json.ke.tasks.item.environment"
66
- },
67
- "upload_path": {
68
- "type": "string",
69
- "id": "com.mtnsat.zerg.json.ke.tasks.item.upload_path"
70
- },
71
- "recipe_url": {
72
- "type": "string",
73
- "id": "com.mtnsat.zerg.json.ke.tasks.item.recipe_url"
74
- },
75
- "client_key_path": {
76
- "type": "string",
77
- "id": "com.mtnsat.zerg.json.ke.tasks.item.client_key_path"
78
- },
79
- "validation_client_name": {
80
- "type": "string",
81
- "id": "com.mtnsat.zerg.json.ke.tasks.item.validation_client_name"
82
- },
83
- "arguments": {
84
- "type": "string",
85
- "id": "com.mtnsat.zerg.json.ke.tasks.item.arguments"
86
- },
87
- "chef_server_url": {
88
- "type": "string",
89
- "id": "com.mtnsat.zerg.json.ke.tasks.item.chef_server_url"
90
- },
91
- "validation_key_path": {
92
- "type": "string",
93
- "id": "com.mtnsat.zerg.json.ke.tasks.item.validation_key_path"
94
- },
95
- "encrypted_data_bag_secret_key_path": {
96
- "type": "string",
97
- "id": "com.mtnsat.zerg.json.ke.tasks.item.encrypted_data_bag_secret_key_path"
98
- },
99
- "binary_path": {
100
- "type": "string",
101
- "id": "com.mtnsat.zerg.json.ke.tasks.item.binary_path"
102
- },
103
- "custom_config_path": {
104
- "type": "string",
105
- "id": "com.mtnsat.zerg.json.ke.tasks.item.custom_config_path"
106
- },
107
- "formatter": {
108
- "type": "string",
109
- "id": "com.mtnsat.zerg.json.ke.tasks.item.formatter"
110
- },
111
- "http_proxy": {
112
- "type": "string",
113
- "id": "com.mtnsat.zerg.json.ke.tasks.item.http_proxy"
114
- },
115
- "http_proxy_user": {
116
- "type": "string",
117
- "id": "com.mtnsat.zerg.json.ke.tasks.item.http_proxy_user"
118
- },
119
- "http_proxy_pass": {
120
- "type": "string",
121
- "id": "com.mtnsat.zerg.json.ke.tasks.item.http_proxy_pass"
122
- },
123
- "no_proxy": {
124
- "type": "string",
125
- "id": "com.mtnsat.zerg.json.ke.tasks.item.no_proxy"
126
- },
127
- "https_proxy": {
128
- "type": "string",
129
- "id": "com.mtnsat.zerg.json.ke.tasks.item.https_proxy"
130
- },
131
- "https_proxy_user": {
132
- "type": "string",
133
- "id": "com.mtnsat.zerg.json.ke.tasks.item.https_proxy_user"
134
- },
135
- "https_proxy_pass": {
136
- "type": "string",
137
- "id": "com.mtnsat.zerg.json.ke.tasks.item.https_proxy_pass"
138
- },
139
- "log_level": {
140
- "type": "string",
141
- "id": "com.mtnsat.zerg.json.ke.tasks.item.log_level"
142
- },
143
- "provisioning_path": {
144
- "type": "string",
145
- "id": "com.mtnsat.zerg.json.ke.tasks.item.provisioning_path"
146
- },
147
- "file_cache_path": {
148
- "type": "string",
149
- "id": "com.mtnsat.zerg.json.ke.tasks.item.file_cache_path"
150
- },
151
- "file_backup_path": {
152
- "type": "string",
153
- "id": "com.mtnsat.zerg.json.ke.tasks.item.file_backup_path"
154
- },
155
- "verbose_logging": {
156
- "type": "boolean",
157
- "id": "com.mtnsat.zerg.json.ke.tasks.item.verbose_logging"
158
- },
159
- "delete_node": {
160
- "type": "boolean",
161
- "id": "com.mtnsat.zerg.json.ke.tasks.item.delete_node"
162
- },
163
- "delete_client": {
164
- "type": "boolean",
165
- "id": "com.mtnsat.zerg.json.ke.tasks.item.delete_client"
166
- },
167
- "nfs": {
168
- "type": "boolean",
169
- "id": "com.mtnsat.zerg.json.ke.tasks.item.nfs"
170
- },
171
- "binary": {
172
- "type": "boolean",
173
- "id": "com.mtnsat.zerg.json.ke.tasks.item.binary"
174
- },
175
- "keep_color": {
176
- "type": "boolean",
177
- "id": "com.mtnsat.zerg.json.ke.tasks.item.keep_color"
178
- },
179
- "priveleged": {
180
- "type": "boolean",
181
- "id": "com.mtnsat.zerg.json.ke.tasks.item.priveleged"
182
- },
183
- "attempts": {
184
- "type": "integer",
185
- "id": "com.mtnsat.zerg.json.ke.tasks.item.attempts"
186
- },
187
- "json": {
188
- "type": "object",
189
- "id": "com.mtnsat.zerg.json.ke.tasks.item.json"
190
- },
191
- "cookbooks_path": {
192
- "type": "array",
193
- "id": "com.mtnsat.zerg.json.ke.tasks.item.cookbooks_path",
194
- "minItems": 1,
195
- "items": [
196
- {
197
- "type": "string"
198
- }
199
- ]
200
- },
201
- "args": {
202
- "type": "array",
203
- "id": "com.mtnsat.zerg.json.ke.tasks.item.args",
204
- "minItems": 1,
205
- "items": [
206
- {
207
- "type": "string"
208
- }
209
- ]
210
- },
211
- "roles_path": {
212
- "type": "array",
213
- "id": "com.mtnsat.zerg.json.ke.tasks.item.roles_path",
214
- "minItems": 1,
215
- "items": [
216
- {
217
- "type": "string"
218
- }
219
- ]
220
- },
221
- "data_bags_path": {
222
- "type": "array",
223
- "id": "com.mtnsat.zerg.json.ke.tasks.item.data_bags_path",
224
- "minItems": 1,
225
- "items": [
226
- {
227
- "type": "string"
228
- }
229
- ]
230
- },
231
- "environments_path": {
232
- "type": "array",
233
- "id": "com.mtnsat.zerg.json.ke.tasks.item.environments_path",
234
- "minItems": 1,
235
- "items": [
236
- {
237
- "type": "string"
238
- }
239
- ]
240
- },
241
- "run_list": {
242
- "type": "array",
243
- "id": "com.mtnsat.zerg.json.ke.tasks.item.recipes",
244
- "minItems": 1,
245
- "items": [
246
- {
247
- "type": "string"
248
- }
249
- ]
250
- },
251
- "roles": {
252
- "type": "array",
253
- "id": "com.mtnsat.zerg.json.ke.tasks.item.roles",
254
- "minItems": 1,
255
- "items": [
256
- {
257
- "type": "string"
258
- }
259
- ]
260
- }
261
- },
262
- "required": [
263
- "type"
264
- ],
265
- "additionalProperties": false
37
+ <%= driver_tasks_schema %>
266
38
  }
267
39
  },
268
40
  "vm": {
269
41
  "type": "object",
270
- "id": "com.mtnsat.zerg.json.ke.vm",
271
42
  "properties": {
272
43
  "driver": {
273
44
  "type": "object",
274
- "id": "com.mtnsat.zerg.json.ke.vm.driver",
275
45
  "properties": {
276
46
  "drivertype": {
277
- "type": "string",
278
- "id": "com.mtnsat.zerg.json.ke.vm.driver.drivertype",
279
- "pattern": "^(vagrant)$"
47
+ "type": "string"
280
48
  },
281
49
  "providertype": {
282
- "type": "string",
283
- "id": "com.mtnsat.zerg.json.ke.vm.driver.providertype",
284
- "pattern": "^(virtualbox|aws|libvirt)$"
50
+ "type": "string"
285
51
  },
286
52
  "provider_options": {
287
- "type": "array",
288
- "id": "com.mtnsat.zerg.json.ke.vm.driver.provider_options"
53
+ "type": "array"
289
54
  }
290
55
  },
291
56
  "required": [
@@ -296,20 +61,16 @@
296
61
  "additionalProperties": false
297
62
  },
298
63
  "private_network": {
299
- "type": "boolean",
300
- "id": "com.mtnsat.zerg.json.ke.vm.private_network"
64
+ "type": "boolean"
301
65
  },
302
66
  "basebox": {
303
- "type": "string",
304
- "id": "com.mtnsat.zerg.json.ke.vm.basebox"
67
+ "type": "string"
305
68
  },
306
69
  "bridge_description": {
307
- "type": "string",
308
- "id": "com.mtnsat.zerg.json.ke.vm.bridge_description"
70
+ "type": "string"
309
71
  },
310
72
  "keepalive": {
311
- "type": "boolean",
312
- "id": "com.mtnsat.zerg.json.ke.vm.keepalive"
73
+ "type": "boolean"
313
74
  }
314
75
  },
315
76
  "required": [
@@ -72,8 +72,9 @@ Feature: Hive
72
72
  """
73
73
  And the exit status should be 0
74
74
 
75
- @no-clobber
75
+ @announce
76
76
  Scenario: Verifying hive
77
+ When I run `zerg init`
77
78
  When I run `zerg hive verify`
78
79
  Then the output should contain:
79
80
  """
data/lib/zerg.rb CHANGED
@@ -23,8 +23,7 @@
23
23
 
24
24
  require "zerg/hive"
25
25
  require "zerg/runner"
26
- require "zerg/driver_renderer"
27
-
26
+ require "zerg/gem_plugin"
28
27
  module Zerg
29
28
 
30
29
  end
@@ -0,0 +1,35 @@
1
+ #--
2
+
3
+ # Copyright 2014 by MTN Sattelite Communications
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to
7
+ # deal in the Software without restriction, including without limitation the
8
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9
+ # sell copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in
13
+ # all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21
+ # IN THE SOFTWARE.
22
+ #++
23
+
24
+ require 'erb'
25
+ require 'ostruct'
26
+
27
+ class Erbalize < OpenStruct
28
+ def self.erbalize_hash(template, sources)
29
+ Erbalize.new(sources).render(template)
30
+ end
31
+
32
+ def render(template)
33
+ ERB.new(template, nil, '-').result(binding)
34
+ end
35
+ end