elevage 0.1.0

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.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +21 -0
  4. data/.rubocop.yml +8 -0
  5. data/.ruby-version +1 -0
  6. data/.simplecov +8 -0
  7. data/.travis.yml +3 -0
  8. data/.yardoc/checksums +12 -0
  9. data/.yardoc/object_types +0 -0
  10. data/.yardoc/objects/root.dat +0 -0
  11. data/.yardoc/proxy_types +0 -0
  12. data/Gemfile +4 -0
  13. data/Guardfile +10 -0
  14. data/LICENSE.txt +203 -0
  15. data/README.md +112 -0
  16. data/Rakefile +20 -0
  17. data/bin/elevage +4 -0
  18. data/coverage/.resultset.json.lock +0 -0
  19. data/doc/Elevage/Build.html +435 -0
  20. data/doc/Elevage/CLI.html +282 -0
  21. data/doc/Elevage/Environment.html +950 -0
  22. data/doc/Elevage/Generate.html +346 -0
  23. data/doc/Elevage/Health.html +359 -0
  24. data/doc/Elevage/New.html +411 -0
  25. data/doc/Elevage/Platform.html +1119 -0
  26. data/doc/Elevage/Provisioner.html +804 -0
  27. data/doc/Elevage/ProvisionerRunQueue.html +765 -0
  28. data/doc/Elevage/Runner.html +319 -0
  29. data/doc/Elevage.html +501 -0
  30. data/doc/_index.html +239 -0
  31. data/doc/class_list.html +58 -0
  32. data/doc/css/common.css +1 -0
  33. data/doc/css/full_list.css +57 -0
  34. data/doc/css/style.css +339 -0
  35. data/doc/file.README.html +187 -0
  36. data/doc/file_list.html +60 -0
  37. data/doc/frames.html +26 -0
  38. data/doc/index.html +187 -0
  39. data/doc/js/app.js +219 -0
  40. data/doc/js/full_list.js +181 -0
  41. data/doc/js/jquery.js +4 -0
  42. data/doc/method_list.html +369 -0
  43. data/doc/top-level-namespace.html +112 -0
  44. data/elevage.gemspec +39 -0
  45. data/features/archive +314 -0
  46. data/features/build.feature +237 -0
  47. data/features/elevage.feature +24 -0
  48. data/features/generate.feature +235 -0
  49. data/features/health_env_failure.feature +292 -0
  50. data/features/health_failure.feature +291 -0
  51. data/features/health_success.feature +279 -0
  52. data/features/list.feature +315 -0
  53. data/features/new.feature +68 -0
  54. data/features/step_definitions/elevage_steps.rb +27 -0
  55. data/features/support/env.rb +9 -0
  56. data/lib/elevage/build.rb +109 -0
  57. data/lib/elevage/constants.rb +113 -0
  58. data/lib/elevage/environment.rb +223 -0
  59. data/lib/elevage/generate.rb +48 -0
  60. data/lib/elevage/health.rb +27 -0
  61. data/lib/elevage/new.rb +30 -0
  62. data/lib/elevage/platform.rb +105 -0
  63. data/lib/elevage/provisioner.rb +169 -0
  64. data/lib/elevage/provisionerrunqueue.rb +114 -0
  65. data/lib/elevage/runner.rb +39 -0
  66. data/lib/elevage/templates/compute.yml.tt +18 -0
  67. data/lib/elevage/templates/environment.yml.tt +20 -0
  68. data/lib/elevage/templates/network.yml.tt +16 -0
  69. data/lib/elevage/templates/platform.yml.tt +110 -0
  70. data/lib/elevage/templates/vcenter.yml.tt +77 -0
  71. data/lib/elevage/version.rb +4 -0
  72. data/lib/elevage.rb +45 -0
  73. data/spec/spec_helper.rb +4 -0
  74. metadata +357 -0
@@ -0,0 +1,24 @@
1
+ Feature: Behavior of CLI with general features and commands
2
+
3
+ As an Infracoder developing a command line tool
4
+ I want to have the basic structure of the tool setup
5
+ In order to engage in the BDD of the tool
6
+
7
+ Scenario: General help banner works
8
+
9
+ When I get general help for "elevage"
10
+ Then the exit status should be 0
11
+ And the banner should be present
12
+ And the following commands should be documented:
13
+ |health|
14
+ |help|
15
+ |list|
16
+ |new|
17
+ |version|
18
+ |generate|
19
+ |build|
20
+
21
+ Scenario: Can display gem version
22
+
23
+ When I run `elevage -v`
24
+ Then the output should display the version
@@ -0,0 +1,235 @@
1
+ Feature: GENERATE new environment yml file
2
+
3
+ As an Infracoder developing a command line tool
4
+ I want to be able to automatically create a new environment file based on the platform definition
5
+ In order to maintain the health of the elevage platform definition files
6
+
7
+ Scenario: generate new environment file from the following platform definition
8
+
9
+ Given a file named "platform.yml" with:
10
+ """
11
+ platform:
12
+ name: app
13
+ description: 'description of the app'
14
+
15
+ environments:
16
+ - int
17
+ - prod
18
+
19
+ tiers:
20
+ - Web
21
+ - App
22
+
23
+ nodenameconvention:
24
+ - environment
25
+ - '-'
26
+ - component
27
+ - '-'
28
+ - instance
29
+ - geo
30
+
31
+ pools:
32
+ webvmdefaults: &webvmdefaults
33
+ count: 2
34
+ tier: Web
35
+ image: 'centos-6.5-x86_64-20140714'
36
+ compute: nonprodweb
37
+ port: 80
38
+ runlist:
39
+ - 'role[loc_uswest]'
40
+ - 'role[base]'
41
+ componentrole: 'role[#]'
42
+
43
+ appvmdefaults: &appvmdefaults
44
+ <<: *webvmdefaults
45
+ tier: App
46
+ compute: nonprodapp
47
+
48
+ components:
49
+ api:
50
+ <<: *webvmdefaults
51
+ port: 8080
52
+
53
+ cui:
54
+ <<: *webvmdefaults
55
+ port: 8082
56
+
57
+ terracotta:
58
+ <<: *webvmdefaults
59
+ compute: nonprodtc
60
+ image: 'centos32g-6.5-x86_64-20140714'
61
+
62
+ email:
63
+ <<: *appvmdefaults
64
+ port: 8130
65
+
66
+ mq:
67
+ <<: *appvmdefaults
68
+ port: 1234
69
+ compute: nonprodmq
70
+ image: 'centos32g-6.5-x86_64-20140714'
71
+ """
72
+ Given a file named "infrastructure/vcenter.yml" with:
73
+ """
74
+ vcenter:
75
+ nonprod: &vcenter
76
+ geo: west
77
+ timezone: 085
78
+
79
+ host: 'www.google.com'
80
+ datacenter: 'WCDC NonProd'
81
+ imagefolder: 'Corporate/Platform Services/Templates'
82
+ destfolder: 'Corporate/Platform Services/app'
83
+ resourcepool: 'App-Web Linux/Corporate'
84
+ appendenv: true
85
+ appenddomain: true
86
+ datastores:
87
+ - NonProd_Cor_25
88
+ - NonProd_Cor_26
89
+ - NonProd_Cor_38
90
+ - NonProd_Cor_39
91
+
92
+ domain: dev.corp.local
93
+ dnsips:
94
+ - 10.10.10.5
95
+ - 10.10.10.6
96
+
97
+ prod:
98
+ <<: *vcenter
99
+
100
+ datacenter: 'WCDC Prod'
101
+ datastores:
102
+ - Prod_Cor_03
103
+ - Prod_Cor_04
104
+
105
+ domain: corp.local
106
+ dnsips:
107
+ - 10.20.100.5
108
+ - 10.20.100.6
109
+ """
110
+ Given a file named "infrastructure/network.yml" with:
111
+ """
112
+ network:
113
+ devweb:
114
+ vlanid: DEV_WEB_NET
115
+ gateway: 10.10.128.1
116
+ netmask: 19
117
+
118
+ devapp:
119
+ vlanid: DEV_APP_NET
120
+ gateway: 10.10.160.1
121
+ netmask: 20
122
+
123
+ prodweb:
124
+ vlanid: PRD_WEB_NET
125
+ gateway: 10.119.128.1
126
+ netmask: 19
127
+
128
+ prodapp:
129
+ vlanid: PRD_APP_NET
130
+ gateway: 10.119.160.1
131
+ netmask: 20
132
+ """
133
+ Given a file named "infrastructure/compute.yml" with:
134
+ """
135
+ compute:
136
+ default: &default
137
+ cpu: 2
138
+ ram: 2
139
+
140
+ nonprodweb:
141
+ <<: *default
142
+
143
+ nonprodapp:
144
+ <<: *default
145
+ ram: 6
146
+
147
+ nonprodtc:
148
+ <<: *default
149
+ ram: 8
150
+
151
+ nonprodmq:
152
+ <<: *default
153
+ ram: 12
154
+
155
+ prodweb:
156
+ <<: *default
157
+ ram: 6
158
+
159
+ prodapp:
160
+ <<: *default
161
+ ram: 6
162
+
163
+ prodtc:
164
+ <<: *default
165
+ ram: 32
166
+
167
+ prodmq:
168
+ <<: *default
169
+ cpu: 8
170
+ ram: 32
171
+ """
172
+
173
+ When I run `elevage generate qa`
174
+ Then the exit status should be 0
175
+ And the output should contain "qa.yml added in environments folder"
176
+ And the file "environments/qa.yml" should contain:
177
+ """
178
+ ? "%YAML 1.2"
179
+ environment:
180
+ vcenter:
181
+ # Environment files are generated from the platform.yml defintion.
182
+ #
183
+ # You can override any of the default values based on the requirements
184
+ # of this particular environment. Though typically you will only
185
+ # want to override things like:
186
+ #
187
+ # count The number of components in the load balance pool
188
+ # compute Size of compute resource to assign, defined in the compute.yml file
189
+ # network vlan the component nodes are attached
190
+ #
191
+ # Additionally, you must specify IP addresses for each node. The generate
192
+ # command will create array placeholders based on the default Count
193
+ #
194
+ pools:
195
+ webvmdefaults: &webvmdefaults
196
+ network:
197
+
198
+ appvmdefaults: &appvmdefaults
199
+ <<: *webvmdefaults
200
+ network:
201
+
202
+
203
+ components:
204
+ api:
205
+ <<: *webvmdefaults
206
+ addresses:
207
+ -
208
+ -
209
+
210
+ cui:
211
+ <<: *webvmdefaults
212
+ addresses:
213
+ -
214
+ -
215
+
216
+ terracotta:
217
+ <<: *webvmdefaults
218
+ addresses:
219
+ -
220
+ -
221
+
222
+ email:
223
+ <<: *appvmdefaults
224
+ addresses:
225
+ -
226
+ -
227
+
228
+ mq:
229
+ <<: *appvmdefaults
230
+ addresses:
231
+ -
232
+ -
233
+
234
+
235
+ """
@@ -0,0 +1,292 @@
1
+ Feature: HEALTH check of erroneous environment-only definition file items
2
+
3
+ As an Infracoder developing a command line tool
4
+ I want to be able to diagnose the syntactical health of the standard platform definition and environment definition yml files
5
+ In order to maintain the health of the elevage platform definition files
6
+
7
+ Scenario: check health of standard desired state items
8
+
9
+
10
+ Given a file named "platform.yml" with:
11
+ """
12
+ platform:
13
+ name: app
14
+ description: 'description of the app'
15
+
16
+ environments:
17
+ - int
18
+ - prod
19
+
20
+ tiers:
21
+ - Web
22
+ - App
23
+
24
+ nodenameconvention:
25
+ - environment
26
+ - '-'
27
+ - component
28
+ - '-'
29
+ - instance
30
+ - geo
31
+
32
+ pools:
33
+ webvmdefaults: &webvmdefaults
34
+ count: 2
35
+ tier: Web
36
+ image: 'centos-6.5-x86_64-20140714'
37
+ compute: nonprodweb
38
+ port: 80
39
+ runlist:
40
+ - 'role[loc_uswest]'
41
+ - 'role[base]'
42
+ componentrole: 'role[#]'
43
+
44
+ appvmdefaults: &appvmdefaults
45
+ <<: *webvmdefaults
46
+ tier: App
47
+ compute: nonprodapp
48
+
49
+ components:
50
+ api:
51
+ <<: *webvmdefaults
52
+ port: 8080
53
+
54
+ cui:
55
+ <<: *webvmdefaults
56
+ port: 8082
57
+
58
+ terracotta:
59
+ <<: *webvmdefaults
60
+ compute: nonprodtc
61
+ image: 'centos32g-6.5-x86_64-20140714'
62
+
63
+ email:
64
+ <<: *appvmdefaults
65
+ port: 8130
66
+
67
+ mq:
68
+ <<: *appvmdefaults
69
+ port: 1234
70
+ compute: nonprodmq
71
+ image: 'centos32g-6.5-x86_64-20140714'
72
+ """
73
+ Given a file named "infrastructure/vcenter.yml" with:
74
+ """
75
+ vcenter:
76
+ nonprod: &vcenter
77
+ geo: west
78
+ timezone: 085
79
+
80
+ host: 'www.google.com'
81
+ datacenter: 'WCDC NonProd'
82
+ imagefolder: 'Corporate/Platform Services/Templates'
83
+ destfolder: 'Corporate/Platform Services/app'
84
+ resourcepool: 'App-Web Linux/Corporate'
85
+ appendenv: true
86
+ appenddomain: true
87
+ datastores:
88
+ - NonProd_Cor_25
89
+ - NonProd_Cor_26
90
+ - NonProd_Cor_38
91
+ - NonProd_Cor_39
92
+
93
+ domain: dev.corp.local
94
+ dnsips:
95
+ - 10.10.10.5
96
+ - 10.10.10.6
97
+
98
+ prod:
99
+ <<: *vcenter
100
+
101
+ datacenter: 'WCDC Prod'
102
+ datastores:
103
+ - Prod_Cor_03
104
+ - Prod_Cor_04
105
+
106
+ domain: corp.local
107
+ dnsips:
108
+ - 10.20.100.5
109
+ - 10.20.100.6
110
+ """
111
+ Given a file named "infrastructure/network.yml" with:
112
+ """
113
+ network:
114
+ devweb:
115
+ vlanid: DEV_WEB_NET
116
+ gateway: 10.10.128.1
117
+ netmask: 19
118
+
119
+ devapp:
120
+ vlanid: DEV_APP_NET
121
+ gateway: 10.10.160.1
122
+ netmask: 20
123
+
124
+ prodweb:
125
+ vlanid: PRD_WEB_NET
126
+ gateway: 10.119.128.1
127
+ netmask: 19
128
+
129
+ prodapp:
130
+ vlanid: PRD_APP_NET
131
+ gateway: 10.119.160.1
132
+ netmask: 20
133
+ """
134
+ Given a file named "infrastructure/compute.yml" with:
135
+ """
136
+ compute:
137
+ default: &default
138
+ cpu: 2
139
+ ram: 2
140
+
141
+ nonprodweb:
142
+ <<: *default
143
+
144
+ nonprodapp:
145
+ <<: *default
146
+ ram: 6
147
+
148
+ nonprodtc:
149
+ <<: *default
150
+ ram: 8
151
+
152
+ nonprodmq:
153
+ <<: *default
154
+ ram: 12
155
+
156
+ prodweb:
157
+ <<: *default
158
+ ram: 6
159
+
160
+ prodapp:
161
+ <<: *default
162
+ ram: 6
163
+
164
+ prodtc:
165
+ <<: *default
166
+ ram: 32
167
+
168
+ prodmq:
169
+ <<: *default
170
+ cpu: 8
171
+ ram: 32
172
+ """
173
+ Given a file named "environments/int.yml" with:
174
+ """
175
+ environment:
176
+ vcenter: nonprod
177
+
178
+ pool:
179
+ webvmdefaults: &webvmdefaults
180
+ network: devweb
181
+
182
+ appvmdefaults: &appvmdefaults
183
+ <<: *webvmdefaults
184
+ network: devapp
185
+
186
+ components:
187
+ api:
188
+ <<: *webvmdefaults
189
+ addresses:
190
+ - 10.10.137.42
191
+ - 10.10.137.43
192
+
193
+ cui:
194
+ <<: *webvmdefaults
195
+ addresses:
196
+ - 10.10.137.64
197
+ - 10.10.137.65
198
+
199
+ terracotta:
200
+ <<: *webvmdefaults
201
+ addresses:
202
+ - 10.10.137.95
203
+ - 10.10.137.96
204
+
205
+ email:
206
+ <<: *appvmdefaults
207
+ addresses:
208
+ - 10.10.161.53
209
+ - 10.10.161.54
210
+
211
+ mq:
212
+ <<: *appvmdefaults
213
+ addresses:
214
+ - 10.10.161.77
215
+ - 10.10.161.78
216
+ """
217
+ Given a file named "environments/prod.yml" with:
218
+ """
219
+ environment:
220
+ vcenter: unknown
221
+
222
+ pool:
223
+ webvmdefaults: &webvmdefaults
224
+ network: prodweb
225
+ count: 4
226
+ compute: prodweb
227
+
228
+ appvmdefaults: &appvmdefaults
229
+ <<: *webvmdefaults
230
+ network: unknown
231
+ compute: prodapp
232
+
233
+
234
+ components:
235
+ api:
236
+ <<: *webvmdefaults
237
+ addresses:
238
+ - 10.119.137.72
239
+ - 10.119.137.73
240
+ - 10.119.137.74
241
+ - 10.119.137.75
242
+
243
+ cui:
244
+ <<: *webvmdefaults
245
+ addresses:
246
+ - 10.119.137.133
247
+ - 10.119.137.134
248
+ - 10.119.137.135
249
+ - 10.119.137.136
250
+
251
+ terracotta:
252
+ <<: *webvmdefaults
253
+ count: 1024
254
+ compute:
255
+ tier: unknown
256
+ image:
257
+ runlist:
258
+ componentrole: unknown
259
+ addresses:
260
+ - 10.119.137.218
261
+ - 10.119.137.219
262
+ port: unknown
263
+
264
+ email:
265
+ <<: *appvmdefaults
266
+ addresses:
267
+ - 10.119.161.137
268
+ - 10.119.161.138
269
+ - 10.119.161.139
270
+ - 10.119.161.140
271
+
272
+ mq:
273
+ <<: *appvmdefaults
274
+ count: 2
275
+ compute: prodmq
276
+ addresses:
277
+ - 10.119.161.206
278
+ - 10.119.161.207
279
+ """
280
+ When I run `elevage health`
281
+ Then the exit status should be 1
282
+ And the output should contain "Environment contains invalid vcenter definition"
283
+ And the output should contain "Environment contains invalid network definition"
284
+ And the output should contain "Environment contains invalid number of nodes in pool"
285
+ And the output should contain "Environment component pool contains invalid compute definition"
286
+ And the output should contain "Environment component pool contains invalid or missing ip address definition"
287
+ And the output should contain "Environment component pool contains invalid tier definition"
288
+ And the output should contain "Environment component pool contains invalid image definition"
289
+ And the output should contain "Environment component pool contains invalid port definition"
290
+ And the output should contain "Environment component pool contains invalid runlist specification"
291
+ And the output should contain "Environment component pool contains invalid componentrole definition"
292
+ ## And the output should contain "Environment components do not match platform definition"