compote 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +103 -0
- data/Rakefile +7 -0
- data/bin/pry +15 -0
- data/bin/rake +12 -0
- data/bin/rspec +12 -0
- data/compote.gemspec +43 -0
- data/config/gems/rspec/.rspec +2 -0
- data/config/gems/rspec/tasks.rake +9 -0
- data/exe/compote +6 -0
- data/lib/compote.rb +22 -0
- data/lib/compote/cli.rb +74 -0
- data/lib/compote/cli/command.rb +69 -0
- data/lib/compote/cli/commands.rb +31 -0
- data/lib/compote/cli/compose.rb +41 -0
- data/lib/compote/cli/env.rb +23 -0
- data/lib/compote/cli/help.rb +23 -0
- data/lib/compote/cli/version.rb +31 -0
- data/lib/compote/config.rb +272 -0
- data/lib/compote/error.rb +144 -0
- data/lib/compote/schema.json +486 -0
- data/lib/compote/schema.rb +371 -0
- data/lib/compote/service_config.rb +81 -0
- data/lib/compote/version.rb +5 -0
- metadata +267 -0
@@ -0,0 +1,486 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"id": "compote_2.1.json",
|
4
|
+
"type": "object",
|
5
|
+
|
6
|
+
"properties": {
|
7
|
+
"version": {
|
8
|
+
"type": "string",
|
9
|
+
"enum": ["2.1"]
|
10
|
+
},
|
11
|
+
|
12
|
+
"services": {
|
13
|
+
"type": "object",
|
14
|
+
"patternProperties": {
|
15
|
+
"^[a-zA-Z0-9._-]+$": {
|
16
|
+
"$ref": "#/definitions/service"
|
17
|
+
}
|
18
|
+
},
|
19
|
+
"additionalProperties": false
|
20
|
+
},
|
21
|
+
|
22
|
+
"networks": {
|
23
|
+
"type": "object",
|
24
|
+
"patternProperties": {
|
25
|
+
"^[a-zA-Z0-9._-]+$": {
|
26
|
+
"$ref": "#/definitions/network"
|
27
|
+
}
|
28
|
+
},
|
29
|
+
"additionalProperties": false
|
30
|
+
},
|
31
|
+
|
32
|
+
"volumes": {
|
33
|
+
"type": "object",
|
34
|
+
"patternProperties": {
|
35
|
+
"^[a-zA-Z0-9._-]+$": {
|
36
|
+
"$ref": "#/definitions/volume"
|
37
|
+
}
|
38
|
+
},
|
39
|
+
"additionalProperties": false
|
40
|
+
},
|
41
|
+
|
42
|
+
"compote": {
|
43
|
+
"type": "object",
|
44
|
+
"properties": {
|
45
|
+
"extends": {
|
46
|
+
"oneOf": [
|
47
|
+
{"$ref": "#/definitions/string_or_list"},
|
48
|
+
{
|
49
|
+
"type": "object",
|
50
|
+
"patternProperties": {
|
51
|
+
"^.+$": {
|
52
|
+
"oneOf": [
|
53
|
+
{ "type": "null" },
|
54
|
+
{
|
55
|
+
"type": "object",
|
56
|
+
"properties": {
|
57
|
+
"only": {"$ref": "#/definitions/string_or_list"},
|
58
|
+
"except": {"$ref": "#/definitions/string_or_list"}
|
59
|
+
},
|
60
|
+
"additionalProperties": false
|
61
|
+
}
|
62
|
+
]
|
63
|
+
}
|
64
|
+
},
|
65
|
+
"additionalProperties": false
|
66
|
+
}
|
67
|
+
]
|
68
|
+
},
|
69
|
+
"env_file": {"$ref": "#/definitions/string_or_list"},
|
70
|
+
"environment": {"$ref": "#/definitions/list_or_dict"},
|
71
|
+
"commands": {
|
72
|
+
"type": "object",
|
73
|
+
"patternProperties": {
|
74
|
+
"^[a-zA-Z0-9._-]+$": {
|
75
|
+
"type": "string",
|
76
|
+
"minLength": 1
|
77
|
+
}
|
78
|
+
},
|
79
|
+
"additionalProperties": false
|
80
|
+
}
|
81
|
+
},
|
82
|
+
"additionalProperties": false
|
83
|
+
}
|
84
|
+
},
|
85
|
+
|
86
|
+
"additionalProperties": false,
|
87
|
+
|
88
|
+
"definitions": {
|
89
|
+
|
90
|
+
"service": {
|
91
|
+
"id": "#/definitions/service",
|
92
|
+
"type": "object",
|
93
|
+
|
94
|
+
"properties": {
|
95
|
+
"build": {
|
96
|
+
"oneOf": [
|
97
|
+
{"type": "string"},
|
98
|
+
{
|
99
|
+
"type": "object",
|
100
|
+
"properties": {
|
101
|
+
"context": {"type": "string"},
|
102
|
+
"dockerfile": {"type": "string"},
|
103
|
+
"args": {"$ref": "#/definitions/list_or_dict"}
|
104
|
+
},
|
105
|
+
"additionalProperties": false
|
106
|
+
}
|
107
|
+
]
|
108
|
+
},
|
109
|
+
"cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
110
|
+
"cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
111
|
+
"cgroup_parent": {"type": "string"},
|
112
|
+
"command": {
|
113
|
+
"oneOf": [
|
114
|
+
{"type": "string"},
|
115
|
+
{"type": "array", "items": {"type": "string"}}
|
116
|
+
]
|
117
|
+
},
|
118
|
+
"container_name": {"type": "string"},
|
119
|
+
"cpu_shares": {"type": ["number", "string"]},
|
120
|
+
"cpu_quota": {"type": ["number", "string"]},
|
121
|
+
"cpuset": {"type": "string"},
|
122
|
+
"depends_on": {
|
123
|
+
"oneOf": [
|
124
|
+
{"$ref": "#/definitions/list_of_strings"},
|
125
|
+
{
|
126
|
+
"type": "object",
|
127
|
+
"additionalProperties": false,
|
128
|
+
"patternProperties": {
|
129
|
+
"^[a-zA-Z0-9._-]+$": {
|
130
|
+
"type": "object",
|
131
|
+
"additionalProperties": false,
|
132
|
+
"properties": {
|
133
|
+
"condition": {
|
134
|
+
"type": "string",
|
135
|
+
"enum": ["service_started", "service_healthy"]
|
136
|
+
}
|
137
|
+
},
|
138
|
+
"required": ["condition"]
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}
|
142
|
+
]
|
143
|
+
},
|
144
|
+
"devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
145
|
+
"dns_opt": {
|
146
|
+
"type": "array",
|
147
|
+
"items": {
|
148
|
+
"type": "string"
|
149
|
+
},
|
150
|
+
"uniqueItems": true
|
151
|
+
},
|
152
|
+
"dns": {"$ref": "#/definitions/string_or_list"},
|
153
|
+
"dns_search": {"$ref": "#/definitions/string_or_list"},
|
154
|
+
"domainname": {"type": "string"},
|
155
|
+
"entrypoint": {
|
156
|
+
"oneOf": [
|
157
|
+
{"type": "string"},
|
158
|
+
{"type": "array", "items": {"type": "string"}}
|
159
|
+
]
|
160
|
+
},
|
161
|
+
"env_file": {"$ref": "#/definitions/string_or_list"},
|
162
|
+
"environment": {"$ref": "#/definitions/list_or_dict"},
|
163
|
+
|
164
|
+
"expose": {
|
165
|
+
"type": "array",
|
166
|
+
"items": {
|
167
|
+
"type": ["string", "number"],
|
168
|
+
"format": "expose"
|
169
|
+
},
|
170
|
+
"uniqueItems": true
|
171
|
+
},
|
172
|
+
|
173
|
+
"extends": {
|
174
|
+
"oneOf": [
|
175
|
+
{
|
176
|
+
"type": "string"
|
177
|
+
},
|
178
|
+
{
|
179
|
+
"type": "object",
|
180
|
+
|
181
|
+
"properties": {
|
182
|
+
"service": {"type": "string"},
|
183
|
+
"file": {"type": "string"}
|
184
|
+
},
|
185
|
+
"required": ["service"],
|
186
|
+
"additionalProperties": false
|
187
|
+
}
|
188
|
+
]
|
189
|
+
},
|
190
|
+
|
191
|
+
"external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
192
|
+
"extra_hosts": {"$ref": "#/definitions/list_or_dict"},
|
193
|
+
"healthcheck": {"$ref": "#/definitions/healthcheck"},
|
194
|
+
"hostname": {"type": "string"},
|
195
|
+
"image": {"type": "string"},
|
196
|
+
"ipc": {"type": "string"},
|
197
|
+
"isolation": {"type": "string"},
|
198
|
+
"labels": {"$ref": "#/definitions/list_or_dict"},
|
199
|
+
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
200
|
+
|
201
|
+
"logging": {
|
202
|
+
"type": "object",
|
203
|
+
|
204
|
+
"properties": {
|
205
|
+
"driver": {"type": "string"},
|
206
|
+
"options": {"type": "object"}
|
207
|
+
},
|
208
|
+
"additionalProperties": false
|
209
|
+
},
|
210
|
+
|
211
|
+
"mac_address": {"type": "string"},
|
212
|
+
"mem_limit": {"type": ["number", "string"]},
|
213
|
+
"mem_reservation": {"type": ["string", "integer"]},
|
214
|
+
"mem_swappiness": {"type": "integer"},
|
215
|
+
"memswap_limit": {"type": ["number", "string"]},
|
216
|
+
"network_mode": {"type": "string"},
|
217
|
+
|
218
|
+
"networks": {
|
219
|
+
"oneOf": [
|
220
|
+
{"$ref": "#/definitions/list_of_strings"},
|
221
|
+
{
|
222
|
+
"type": "object",
|
223
|
+
"patternProperties": {
|
224
|
+
"^[a-zA-Z0-9._-]+$": {
|
225
|
+
"oneOf": [
|
226
|
+
{
|
227
|
+
"type": "object",
|
228
|
+
"properties": {
|
229
|
+
"aliases": {"$ref": "#/definitions/list_of_strings"},
|
230
|
+
"ipv4_address": {"type": "string"},
|
231
|
+
"ipv6_address": {"type": "string"},
|
232
|
+
"link_local_ips": {"$ref": "#/definitions/list_of_strings"}
|
233
|
+
},
|
234
|
+
"additionalProperties": false
|
235
|
+
},
|
236
|
+
{"type": "null"}
|
237
|
+
]
|
238
|
+
}
|
239
|
+
},
|
240
|
+
"additionalProperties": false
|
241
|
+
}
|
242
|
+
]
|
243
|
+
},
|
244
|
+
"oom_score_adj": {"type": "integer", "minimum": -1000, "maximum": 1000},
|
245
|
+
"group_add": {
|
246
|
+
"type": "array",
|
247
|
+
"items": {
|
248
|
+
"type": ["string", "number"]
|
249
|
+
},
|
250
|
+
"uniqueItems": true
|
251
|
+
},
|
252
|
+
"pid": {"type": ["string", "null"]},
|
253
|
+
|
254
|
+
"ports": {
|
255
|
+
"type": "array",
|
256
|
+
"items": {
|
257
|
+
"type": ["string", "number"],
|
258
|
+
"format": "ports"
|
259
|
+
},
|
260
|
+
"uniqueItems": true
|
261
|
+
},
|
262
|
+
|
263
|
+
"privileged": {"type": "boolean"},
|
264
|
+
"read_only": {"type": "boolean"},
|
265
|
+
"restart": {"type": "string"},
|
266
|
+
"security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
267
|
+
"shm_size": {"type": ["number", "string"]},
|
268
|
+
"sysctls": {"$ref": "#/definitions/list_or_dict"},
|
269
|
+
"pids_limit": {"type": ["number", "string"]},
|
270
|
+
"stdin_open": {"type": "boolean"},
|
271
|
+
"stop_grace_period": {"type": "string", "format": "duration"},
|
272
|
+
"stop_signal": {"type": "string"},
|
273
|
+
"tmpfs": {"$ref": "#/definitions/string_or_list"},
|
274
|
+
"tty": {"type": "boolean"},
|
275
|
+
"ulimits": {
|
276
|
+
"type": "object",
|
277
|
+
"patternProperties": {
|
278
|
+
"^[a-z]+$": {
|
279
|
+
"oneOf": [
|
280
|
+
{"type": "integer"},
|
281
|
+
{
|
282
|
+
"type":"object",
|
283
|
+
"properties": {
|
284
|
+
"hard": {"type": "integer"},
|
285
|
+
"soft": {"type": "integer"}
|
286
|
+
},
|
287
|
+
"required": ["soft", "hard"],
|
288
|
+
"additionalProperties": false
|
289
|
+
}
|
290
|
+
]
|
291
|
+
}
|
292
|
+
}
|
293
|
+
},
|
294
|
+
"user": {"type": "string"},
|
295
|
+
"userns_mode": {"type": "string"},
|
296
|
+
"volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
297
|
+
"volume_driver": {"type": "string"},
|
298
|
+
"volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
299
|
+
"working_dir": {"type": "string"},
|
300
|
+
|
301
|
+
"compote": {
|
302
|
+
"type": "object",
|
303
|
+
"properties": {
|
304
|
+
"extends": {
|
305
|
+
"oneOf": [
|
306
|
+
{"$ref": "#/definitions/string_or_list"},
|
307
|
+
{
|
308
|
+
"type": "object",
|
309
|
+
"patternProperties": {
|
310
|
+
"^.+$": {
|
311
|
+
"oneOf": [
|
312
|
+
{ "type": "null" },
|
313
|
+
{
|
314
|
+
"type": "object",
|
315
|
+
"properties": {
|
316
|
+
"only": {"$ref": "#/definitions/string_or_list"},
|
317
|
+
"except": {"$ref": "#/definitions/string_or_list"}
|
318
|
+
},
|
319
|
+
"additionalProperties": false
|
320
|
+
}
|
321
|
+
]
|
322
|
+
}
|
323
|
+
},
|
324
|
+
"additionalProperties": false
|
325
|
+
}
|
326
|
+
]
|
327
|
+
},
|
328
|
+
"networks": {
|
329
|
+
"type": "object",
|
330
|
+
"patternProperties": {
|
331
|
+
"^[a-zA-Z0-9._-]+$": {
|
332
|
+
"$ref": "#/definitions/network"
|
333
|
+
}
|
334
|
+
},
|
335
|
+
"additionalProperties": false
|
336
|
+
},
|
337
|
+
"volumes": {
|
338
|
+
"type": "object",
|
339
|
+
"patternProperties": {
|
340
|
+
"^[a-zA-Z0-9._-]+$": {
|
341
|
+
"$ref": "#/definitions/volume"
|
342
|
+
}
|
343
|
+
},
|
344
|
+
"additionalProperties": false
|
345
|
+
},
|
346
|
+
"commands": {
|
347
|
+
"type": "object",
|
348
|
+
"patternProperties": {
|
349
|
+
"^[a-zA-Z0-9._-]+$": {
|
350
|
+
"type": "string",
|
351
|
+
"minLength": 1
|
352
|
+
}
|
353
|
+
},
|
354
|
+
"additionalProperties": false
|
355
|
+
}
|
356
|
+
},
|
357
|
+
"additionalProperties": false
|
358
|
+
}
|
359
|
+
},
|
360
|
+
|
361
|
+
"dependencies": {
|
362
|
+
"memswap_limit": ["mem_limit"]
|
363
|
+
},
|
364
|
+
"additionalProperties": false
|
365
|
+
},
|
366
|
+
|
367
|
+
"healthcheck": {
|
368
|
+
"id": "#/definitions/healthcheck",
|
369
|
+
"type": "object",
|
370
|
+
"additionalProperties": false,
|
371
|
+
"properties": {
|
372
|
+
"disable": {"type": "boolean"},
|
373
|
+
"interval": {"type": "string"},
|
374
|
+
"retries": {"type": "number"},
|
375
|
+
"test": {
|
376
|
+
"oneOf": [
|
377
|
+
{"type": "string"},
|
378
|
+
{"type": "array", "items": {"type": "string"}}
|
379
|
+
]
|
380
|
+
},
|
381
|
+
"timeout": {"type": "string"}
|
382
|
+
}
|
383
|
+
},
|
384
|
+
|
385
|
+
"network": {
|
386
|
+
"id": "#/definitions/network",
|
387
|
+
"type": "object",
|
388
|
+
"properties": {
|
389
|
+
"driver": {"type": "string"},
|
390
|
+
"driver_opts": {
|
391
|
+
"type": "object",
|
392
|
+
"patternProperties": {
|
393
|
+
"^.+$": {"type": ["string", "number"]}
|
394
|
+
}
|
395
|
+
},
|
396
|
+
"ipam": {
|
397
|
+
"type": "object",
|
398
|
+
"properties": {
|
399
|
+
"driver": {"type": "string"},
|
400
|
+
"config": {
|
401
|
+
"type": "array"
|
402
|
+
}
|
403
|
+
},
|
404
|
+
"additionalProperties": false
|
405
|
+
},
|
406
|
+
"external": {
|
407
|
+
"type": ["boolean", "object"],
|
408
|
+
"properties": {
|
409
|
+
"name": {"type": "string"}
|
410
|
+
},
|
411
|
+
"additionalProperties": false
|
412
|
+
},
|
413
|
+
"internal": {"type": "boolean"},
|
414
|
+
"enable_ipv6": {"type": "boolean"},
|
415
|
+
"labels": {"$ref": "#/definitions/list_or_dict"}
|
416
|
+
},
|
417
|
+
"additionalProperties": false
|
418
|
+
},
|
419
|
+
|
420
|
+
"volume": {
|
421
|
+
"id": "#/definitions/volume",
|
422
|
+
"type": ["object", "null"],
|
423
|
+
"properties": {
|
424
|
+
"driver": {"type": "string"},
|
425
|
+
"driver_opts": {
|
426
|
+
"type": "object",
|
427
|
+
"patternProperties": {
|
428
|
+
"^.+$": {"type": ["string", "number"]}
|
429
|
+
}
|
430
|
+
},
|
431
|
+
"external": {
|
432
|
+
"type": ["boolean", "object"],
|
433
|
+
"properties": {
|
434
|
+
"name": {"type": "string"}
|
435
|
+
},
|
436
|
+
"additionalProperties": false
|
437
|
+
},
|
438
|
+
"labels": {"$ref": "#/definitions/list_or_dict"}
|
439
|
+
},
|
440
|
+
"additionalProperties": false
|
441
|
+
},
|
442
|
+
|
443
|
+
"string_or_list": {
|
444
|
+
"oneOf": [
|
445
|
+
{"type": "string"},
|
446
|
+
{"$ref": "#/definitions/list_of_strings"}
|
447
|
+
]
|
448
|
+
},
|
449
|
+
|
450
|
+
"list_of_strings": {
|
451
|
+
"type": "array",
|
452
|
+
"items": {"type": "string"},
|
453
|
+
"uniqueItems": true
|
454
|
+
},
|
455
|
+
|
456
|
+
"list_or_dict": {
|
457
|
+
"oneOf": [
|
458
|
+
{
|
459
|
+
"type": "object",
|
460
|
+
"patternProperties": {
|
461
|
+
".+": {
|
462
|
+
"type": ["string", "number", "null"]
|
463
|
+
}
|
464
|
+
},
|
465
|
+
"additionalProperties": false
|
466
|
+
},
|
467
|
+
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
468
|
+
]
|
469
|
+
},
|
470
|
+
|
471
|
+
"constraints": {
|
472
|
+
"service": {
|
473
|
+
"id": "#/definitions/constraints/service",
|
474
|
+
"anyOf": [
|
475
|
+
{"required": ["build"]},
|
476
|
+
{"required": ["image"]}
|
477
|
+
],
|
478
|
+
"properties": {
|
479
|
+
"build": {
|
480
|
+
"required": ["context"]
|
481
|
+
}
|
482
|
+
}
|
483
|
+
}
|
484
|
+
}
|
485
|
+
}
|
486
|
+
}
|