pangea-orchestrator 0.0.1
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.
- checksums.yaml +7 -0
- data/.envrc +1 -0
- data/.gitignore +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +114 -0
- data/LICENSE +201 -0
- data/README.md +3 -0
- data/Rakefile +15 -0
- data/flake.lock +93 -0
- data/flake.nix +41 -0
- data/gemset.nix +451 -0
- data/lib/pangea-orchestrator/cli.rb +73 -0
- data/lib/pangea-orchestrator/errors/incorrect_subcommand_error.rb +2 -0
- data/lib/pangea-orchestrator/errors/namespace_not_found_error.rb +2 -0
- data/lib/pangea-orchestrator/errors/no_infra_target_error.rb +2 -0
- data/lib/pangea-orchestrator/errors/project_not_found_error.rb +2 -0
- data/lib/pangea-orchestrator/errors/site_not_found_error.rb +2 -0
- data/lib/pangea-orchestrator/executor.rb +10 -0
- data/lib/pangea-orchestrator/modules.rb +134 -0
- data/lib/pangea-orchestrator/renderer.rb +241 -0
- data/lib/pangea-orchestrator/resources/eks.rb +22 -0
- data/lib/pangea-orchestrator/resources.rb +8 -0
- data/lib/pangea-orchestrator/sandbox.rb +90 -0
- data/lib/pangea-orchestrator/say/init.rb +27 -0
- data/lib/pangea-orchestrator/shell/README.md +1 -0
- data/lib/pangea-orchestrator/shell/terraform.rb +21 -0
- data/lib/pangea-orchestrator/shell.rb +27 -0
- data/lib/pangea-orchestrator/stack.rb +11 -0
- data/lib/pangea-orchestrator/state.rb +96 -0
- data/lib/pangea-orchestrator/structures/README.md +3 -0
- data/lib/pangea-orchestrator/structures/abstract.rb +2 -0
- data/lib/pangea-orchestrator/structures/namespace.rb +4 -0
- data/lib/pangea-orchestrator/structures/project.rb +4 -0
- data/lib/pangea-orchestrator/structures/site.rb +4 -0
- data/lib/pangea-orchestrator/synthesizer/config.rb +38 -0
- data/lib/pangea-orchestrator/utils.rb +32 -0
- data/lib/pangea-orchestrator/version.rb +3 -0
- data/lib/pangea-orchestrator.rb +5 -0
- data/pangea-orchestrator.gemspec +41 -0
- metadata +222 -0
data/gemset.nix
ADDED
@@ -0,0 +1,451 @@
|
|
1
|
+
{
|
2
|
+
abstract-synthesizer = {
|
3
|
+
groups = ["default"];
|
4
|
+
platforms = [];
|
5
|
+
source = {
|
6
|
+
remotes = ["https://rubygems.org"];
|
7
|
+
sha256 = "0n8z91za9cljq8js8hjgnflkhxa1vjvb21wywi48h5cxfzqzi6pv";
|
8
|
+
type = "gem";
|
9
|
+
};
|
10
|
+
version = "0.0.9";
|
11
|
+
};
|
12
|
+
ast = {
|
13
|
+
groups = ["default" "development"];
|
14
|
+
platforms = [];
|
15
|
+
source = {
|
16
|
+
remotes = ["https://rubygems.org"];
|
17
|
+
sha256 = "10yknjyn0728gjn6b5syynvrvrwm66bhssbxq8mkhshxghaiailm";
|
18
|
+
type = "gem";
|
19
|
+
};
|
20
|
+
version = "2.4.3";
|
21
|
+
};
|
22
|
+
date = {
|
23
|
+
groups = ["default" "development"];
|
24
|
+
platforms = [];
|
25
|
+
source = {
|
26
|
+
remotes = ["https://rubygems.org"];
|
27
|
+
sha256 = "0kz6mc4b9m49iaans6cbx031j9y7ldghpi5fzsdh0n3ixwa8w9mz";
|
28
|
+
type = "gem";
|
29
|
+
};
|
30
|
+
version = "3.4.1";
|
31
|
+
};
|
32
|
+
debug = {
|
33
|
+
dependencies = ["irb" "reline"];
|
34
|
+
groups = ["development"];
|
35
|
+
platforms = [];
|
36
|
+
source = {
|
37
|
+
remotes = ["https://rubygems.org"];
|
38
|
+
sha256 = "1977s95s9ns6mpbhg68pg6ggnpxxf8wly4244ihrx5vm92kqrqhi";
|
39
|
+
type = "gem";
|
40
|
+
};
|
41
|
+
version = "1.10.0";
|
42
|
+
};
|
43
|
+
debug_inspector = {
|
44
|
+
groups = ["development"];
|
45
|
+
platforms = [];
|
46
|
+
source = {
|
47
|
+
remotes = ["https://rubygems.org"];
|
48
|
+
sha256 = "18k8x9viqlkh7dbmjzh8crbjy8w480arpa766cw1dnn3xcpa1pwv";
|
49
|
+
type = "gem";
|
50
|
+
};
|
51
|
+
version = "1.2.0";
|
52
|
+
};
|
53
|
+
diff-lcs = {
|
54
|
+
groups = ["default" "development"];
|
55
|
+
platforms = [];
|
56
|
+
source = {
|
57
|
+
remotes = ["https://rubygems.org"];
|
58
|
+
sha256 = "0qlrj2qyysc9avzlr4zs1py3x684hqm61n4czrsk1pyllz5x5q4s";
|
59
|
+
type = "gem";
|
60
|
+
};
|
61
|
+
version = "1.6.2";
|
62
|
+
};
|
63
|
+
erb = {
|
64
|
+
groups = ["default" "development"];
|
65
|
+
platforms = [];
|
66
|
+
source = {
|
67
|
+
remotes = ["https://rubygems.org"];
|
68
|
+
sha256 = "08rc8pzri3g7c85c76x84j05hkk12jvalrm2m3n97k1n7f03j13n";
|
69
|
+
type = "gem";
|
70
|
+
};
|
71
|
+
version = "5.0.1";
|
72
|
+
};
|
73
|
+
io-console = {
|
74
|
+
groups = ["default" "development"];
|
75
|
+
platforms = [];
|
76
|
+
source = {
|
77
|
+
remotes = ["https://rubygems.org"];
|
78
|
+
sha256 = "18pgvl7lfjpichdfh1g50rpz0zpaqrpr52ybn9liv1v9pjn9ysnd";
|
79
|
+
type = "gem";
|
80
|
+
};
|
81
|
+
version = "0.8.0";
|
82
|
+
};
|
83
|
+
irb = {
|
84
|
+
dependencies = ["pp" "rdoc" "reline"];
|
85
|
+
groups = ["default" "development"];
|
86
|
+
platforms = [];
|
87
|
+
source = {
|
88
|
+
remotes = ["https://rubygems.org"];
|
89
|
+
sha256 = "1fpxa2m83rb7xlzs57daqwnzqjmz6j35xr7zb15s73975sak4br2";
|
90
|
+
type = "gem";
|
91
|
+
};
|
92
|
+
version = "1.15.2";
|
93
|
+
};
|
94
|
+
json = {
|
95
|
+
groups = ["default" "development"];
|
96
|
+
platforms = [];
|
97
|
+
source = {
|
98
|
+
remotes = ["https://rubygems.org"];
|
99
|
+
sha256 = "1x5b8ipv6g0z44wgc45039k04smsyf95h2m5m67mqq35sa5a955s";
|
100
|
+
type = "gem";
|
101
|
+
};
|
102
|
+
version = "2.12.2";
|
103
|
+
};
|
104
|
+
language_server-protocol = {
|
105
|
+
groups = ["default" "development"];
|
106
|
+
platforms = [];
|
107
|
+
source = {
|
108
|
+
remotes = ["https://rubygems.org"];
|
109
|
+
sha256 = "1k0311vah76kg5m6zr7wmkwyk5p2f9d9hyckjpn3xgr83ajkj7px";
|
110
|
+
type = "gem";
|
111
|
+
};
|
112
|
+
version = "3.17.0.5";
|
113
|
+
};
|
114
|
+
lint_roller = {
|
115
|
+
groups = ["default" "development"];
|
116
|
+
platforms = [];
|
117
|
+
source = {
|
118
|
+
remotes = ["https://rubygems.org"];
|
119
|
+
sha256 = "11yc0d84hsnlvx8cpk4cbj6a4dz9pk0r1k29p0n1fz9acddq831c";
|
120
|
+
type = "gem";
|
121
|
+
};
|
122
|
+
version = "1.1.0";
|
123
|
+
};
|
124
|
+
logger = {
|
125
|
+
groups = ["default" "development"];
|
126
|
+
platforms = [];
|
127
|
+
source = {
|
128
|
+
remotes = ["https://rubygems.org"];
|
129
|
+
sha256 = "00q2zznygpbls8asz5knjvvj2brr3ghmqxgr83xnrdj4rk3xwvhr";
|
130
|
+
type = "gem";
|
131
|
+
};
|
132
|
+
version = "1.7.0";
|
133
|
+
};
|
134
|
+
pangea-orchestrator = {
|
135
|
+
dependencies = ["abstract-synthesizer" "terraform-synthesizer"];
|
136
|
+
groups = ["default"];
|
137
|
+
platforms = [];
|
138
|
+
source = {
|
139
|
+
path = ./.;
|
140
|
+
type = "path";
|
141
|
+
};
|
142
|
+
version = "0.0.1";
|
143
|
+
};
|
144
|
+
parallel = {
|
145
|
+
groups = ["default" "development"];
|
146
|
+
platforms = [];
|
147
|
+
source = {
|
148
|
+
remotes = ["https://rubygems.org"];
|
149
|
+
sha256 = "0c719bfgcszqvk9z47w2p8j2wkz5y35k48ywwas5yxbbh3hm3haa";
|
150
|
+
type = "gem";
|
151
|
+
};
|
152
|
+
version = "1.27.0";
|
153
|
+
};
|
154
|
+
parser = {
|
155
|
+
dependencies = ["ast" "racc"];
|
156
|
+
groups = ["default" "development"];
|
157
|
+
platforms = [];
|
158
|
+
source = {
|
159
|
+
remotes = ["https://rubygems.org"];
|
160
|
+
sha256 = "0i9w8msil4snx5w11ix9b0wf52vjc3r49khy3ddgl1xk890kcxi4";
|
161
|
+
type = "gem";
|
162
|
+
};
|
163
|
+
version = "3.3.8.0";
|
164
|
+
};
|
165
|
+
pp = {
|
166
|
+
dependencies = ["prettyprint"];
|
167
|
+
groups = ["default" "development"];
|
168
|
+
platforms = [];
|
169
|
+
source = {
|
170
|
+
remotes = ["https://rubygems.org"];
|
171
|
+
sha256 = "1zxnfxjni0r9l2x42fyq0sqpnaf5nakjbap8irgik4kg1h9c6zll";
|
172
|
+
type = "gem";
|
173
|
+
};
|
174
|
+
version = "0.6.2";
|
175
|
+
};
|
176
|
+
prettyprint = {
|
177
|
+
groups = ["default" "development"];
|
178
|
+
platforms = [];
|
179
|
+
source = {
|
180
|
+
remotes = ["https://rubygems.org"];
|
181
|
+
sha256 = "14zicq3plqi217w6xahv7b8f7aj5kpxv1j1w98344ix9h5ay3j9b";
|
182
|
+
type = "gem";
|
183
|
+
};
|
184
|
+
version = "0.2.0";
|
185
|
+
};
|
186
|
+
prism = {
|
187
|
+
groups = ["default" "development"];
|
188
|
+
platforms = [];
|
189
|
+
source = {
|
190
|
+
remotes = ["https://rubygems.org"];
|
191
|
+
sha256 = "0gkhpdjib9zi9i27vd9djrxiwjia03cijmd6q8yj2q1ix403w3nw";
|
192
|
+
type = "gem";
|
193
|
+
};
|
194
|
+
version = "1.4.0";
|
195
|
+
};
|
196
|
+
psych = {
|
197
|
+
dependencies = ["date" "stringio"];
|
198
|
+
groups = ["default" "development"];
|
199
|
+
platforms = [];
|
200
|
+
source = {
|
201
|
+
remotes = ["https://rubygems.org"];
|
202
|
+
sha256 = "0vii1xc7x81hicdbp7dlllhmbw5w3jy20shj696n0vfbbnm2hhw1";
|
203
|
+
type = "gem";
|
204
|
+
};
|
205
|
+
version = "5.2.6";
|
206
|
+
};
|
207
|
+
racc = {
|
208
|
+
groups = ["default" "development"];
|
209
|
+
platforms = [];
|
210
|
+
source = {
|
211
|
+
remotes = ["https://rubygems.org"];
|
212
|
+
sha256 = "0byn0c9nkahsl93y9ln5bysq4j31q8xkf2ws42swighxd4lnjzsa";
|
213
|
+
type = "gem";
|
214
|
+
};
|
215
|
+
version = "1.8.1";
|
216
|
+
};
|
217
|
+
rainbow = {
|
218
|
+
groups = ["default" "development"];
|
219
|
+
platforms = [];
|
220
|
+
source = {
|
221
|
+
remotes = ["https://rubygems.org"];
|
222
|
+
sha256 = "0smwg4mii0fm38pyb5fddbmrdpifwv22zv3d3px2xx497am93503";
|
223
|
+
type = "gem";
|
224
|
+
};
|
225
|
+
version = "3.1.1";
|
226
|
+
};
|
227
|
+
rake = {
|
228
|
+
groups = ["development"];
|
229
|
+
platforms = [];
|
230
|
+
source = {
|
231
|
+
remotes = ["https://rubygems.org"];
|
232
|
+
sha256 = "14s4jdcs1a4saam9qmzbsa2bsh85rj9zfxny5z315x3gg0nhkxcn";
|
233
|
+
type = "gem";
|
234
|
+
};
|
235
|
+
version = "13.3.0";
|
236
|
+
};
|
237
|
+
rbs = {
|
238
|
+
dependencies = ["logger"];
|
239
|
+
groups = ["default" "development"];
|
240
|
+
platforms = [];
|
241
|
+
source = {
|
242
|
+
remotes = ["https://rubygems.org"];
|
243
|
+
sha256 = "1mx533jn2nv29xc5faw9g5xj9qbdaiwl9wv2byv98bgw6gqwhhlf";
|
244
|
+
type = "gem";
|
245
|
+
};
|
246
|
+
version = "3.9.4";
|
247
|
+
};
|
248
|
+
rdoc = {
|
249
|
+
dependencies = ["erb" "psych"];
|
250
|
+
groups = ["default" "development"];
|
251
|
+
platforms = [];
|
252
|
+
source = {
|
253
|
+
remotes = ["https://rubygems.org"];
|
254
|
+
sha256 = "1nyp5vc9nm46nc3aq58f2lackgbip4ynxmznzi1qg6qjsxcdwiic";
|
255
|
+
type = "gem";
|
256
|
+
};
|
257
|
+
version = "6.14.0";
|
258
|
+
};
|
259
|
+
regexp_parser = {
|
260
|
+
groups = ["default" "development"];
|
261
|
+
platforms = [];
|
262
|
+
source = {
|
263
|
+
remotes = ["https://rubygems.org"];
|
264
|
+
sha256 = "0qccah61pjvzyyg6mrp27w27dlv6vxlbznzipxjcswl7x3fhsvyb";
|
265
|
+
type = "gem";
|
266
|
+
};
|
267
|
+
version = "2.10.0";
|
268
|
+
};
|
269
|
+
reline = {
|
270
|
+
dependencies = ["io-console"];
|
271
|
+
groups = ["default" "development"];
|
272
|
+
platforms = [];
|
273
|
+
source = {
|
274
|
+
remotes = ["https://rubygems.org"];
|
275
|
+
sha256 = "1yvm0svcdk6377ng6l00g39ldkjijbqg4whdg2zcsa8hrgbwkz0s";
|
276
|
+
type = "gem";
|
277
|
+
};
|
278
|
+
version = "0.6.1";
|
279
|
+
};
|
280
|
+
rspec = {
|
281
|
+
dependencies = ["rspec-core" "rspec-expectations" "rspec-mocks"];
|
282
|
+
groups = ["development"];
|
283
|
+
platforms = [];
|
284
|
+
source = {
|
285
|
+
remotes = ["https://rubygems.org"];
|
286
|
+
sha256 = "0h11wynaki22a40rfq3ahcs4r36jdpz9acbb3m5dkf0mm67sbydr";
|
287
|
+
type = "gem";
|
288
|
+
};
|
289
|
+
version = "3.13.1";
|
290
|
+
};
|
291
|
+
rspec-core = {
|
292
|
+
dependencies = ["rspec-support"];
|
293
|
+
groups = ["default" "development"];
|
294
|
+
platforms = [];
|
295
|
+
source = {
|
296
|
+
remotes = ["https://rubygems.org"];
|
297
|
+
sha256 = "0n1rlagplpcgp41s3r68z01539aivwj0cn3v19hq4p3pgdmibnpr";
|
298
|
+
type = "gem";
|
299
|
+
};
|
300
|
+
version = "3.13.4";
|
301
|
+
};
|
302
|
+
rspec-expectations = {
|
303
|
+
dependencies = ["diff-lcs" "rspec-support"];
|
304
|
+
groups = ["default" "development"];
|
305
|
+
platforms = [];
|
306
|
+
source = {
|
307
|
+
remotes = ["https://rubygems.org"];
|
308
|
+
sha256 = "0dl8npj0jfpy31bxi6syc7jymyd861q277sfr6jawq2hv6hx791k";
|
309
|
+
type = "gem";
|
310
|
+
};
|
311
|
+
version = "3.13.5";
|
312
|
+
};
|
313
|
+
rspec-mocks = {
|
314
|
+
dependencies = ["diff-lcs" "rspec-support"];
|
315
|
+
groups = ["default" "development"];
|
316
|
+
platforms = [];
|
317
|
+
source = {
|
318
|
+
remotes = ["https://rubygems.org"];
|
319
|
+
sha256 = "10gajm8iscl7gb8q926hyna83bw3fx2zb4sqdzjrznjs51pqlcz4";
|
320
|
+
type = "gem";
|
321
|
+
};
|
322
|
+
version = "3.13.5";
|
323
|
+
};
|
324
|
+
rspec-support = {
|
325
|
+
groups = ["default" "development"];
|
326
|
+
platforms = [];
|
327
|
+
source = {
|
328
|
+
remotes = ["https://rubygems.org"];
|
329
|
+
sha256 = "1xx3f4mgr84jz07fifd3r68hm6giqy91hqyzawmi0s59yqa1hjqq";
|
330
|
+
type = "gem";
|
331
|
+
};
|
332
|
+
version = "3.13.4";
|
333
|
+
};
|
334
|
+
rubocop = {
|
335
|
+
dependencies = ["json" "language_server-protocol" "lint_roller" "parallel" "parser" "rainbow" "regexp_parser" "rubocop-ast" "ruby-progressbar" "unicode-display_width"];
|
336
|
+
groups = ["development"];
|
337
|
+
platforms = [];
|
338
|
+
source = {
|
339
|
+
remotes = ["https://rubygems.org"];
|
340
|
+
sha256 = "1rz0wwhxy6rv0kk2m8jp77fbhwgs7m01p2yys9bj3kwl0xsjsnp1";
|
341
|
+
type = "gem";
|
342
|
+
};
|
343
|
+
version = "1.76.1";
|
344
|
+
};
|
345
|
+
rubocop-ast = {
|
346
|
+
dependencies = ["parser" "prism"];
|
347
|
+
groups = ["default" "development"];
|
348
|
+
platforms = [];
|
349
|
+
source = {
|
350
|
+
remotes = ["https://rubygems.org"];
|
351
|
+
sha256 = "0gis8w51k5dsmzzlppvwwznqyfd73fa3zcrpl1xihzy1mm4jw14l";
|
352
|
+
type = "gem";
|
353
|
+
};
|
354
|
+
version = "1.45.1";
|
355
|
+
};
|
356
|
+
rubocop-rake = {
|
357
|
+
dependencies = ["lint_roller" "rubocop"];
|
358
|
+
groups = ["development"];
|
359
|
+
platforms = [];
|
360
|
+
source = {
|
361
|
+
remotes = ["https://rubygems.org"];
|
362
|
+
sha256 = "0kdfrckz1v32dy7c7bdiksjysx9l9zsda9kc6zvrsghch6vg55rp";
|
363
|
+
type = "gem";
|
364
|
+
};
|
365
|
+
version = "0.7.1";
|
366
|
+
};
|
367
|
+
rubocop-rspec = {
|
368
|
+
dependencies = ["lint_roller" "rubocop"];
|
369
|
+
groups = ["development"];
|
370
|
+
platforms = [];
|
371
|
+
source = {
|
372
|
+
remotes = ["https://rubygems.org"];
|
373
|
+
sha256 = "0ya4815sp8g13w7a86sm0605fx7xyldck77f9pjjfrvpf5c21r60";
|
374
|
+
type = "gem";
|
375
|
+
};
|
376
|
+
version = "3.6.0";
|
377
|
+
};
|
378
|
+
ruby-lsp = {
|
379
|
+
dependencies = ["language_server-protocol" "prism" "rbs" "sorbet-runtime"];
|
380
|
+
groups = ["development"];
|
381
|
+
platforms = [];
|
382
|
+
source = {
|
383
|
+
remotes = ["https://rubygems.org"];
|
384
|
+
sha256 = "1cxyg49nhy137hfjprqwb4h29gmpnwb8yif6qza6p6dgavm98p77";
|
385
|
+
type = "gem";
|
386
|
+
};
|
387
|
+
version = "0.24.1";
|
388
|
+
};
|
389
|
+
ruby-progressbar = {
|
390
|
+
groups = ["default" "development"];
|
391
|
+
platforms = [];
|
392
|
+
source = {
|
393
|
+
remotes = ["https://rubygems.org"];
|
394
|
+
sha256 = "0cwvyb7j47m7wihpfaq7rc47zwwx9k4v7iqd9s1xch5nm53rrz40";
|
395
|
+
type = "gem";
|
396
|
+
};
|
397
|
+
version = "1.13.0";
|
398
|
+
};
|
399
|
+
sorbet-runtime = {
|
400
|
+
groups = ["default" "development"];
|
401
|
+
platforms = [];
|
402
|
+
source = {
|
403
|
+
remotes = ["https://rubygems.org"];
|
404
|
+
sha256 = "029irlivbgfc2j7jlrpd7bpsh4nkcq5zqmyfs0p6j9nii7kn2dz3";
|
405
|
+
type = "gem";
|
406
|
+
};
|
407
|
+
version = "0.5.12167";
|
408
|
+
};
|
409
|
+
stringio = {
|
410
|
+
groups = ["default" "development"];
|
411
|
+
platforms = [];
|
412
|
+
source = {
|
413
|
+
remotes = ["https://rubygems.org"];
|
414
|
+
sha256 = "1yh78pg6lm28c3k0pfd2ipskii1fsraq46m6zjs5yc9a4k5vfy2v";
|
415
|
+
type = "gem";
|
416
|
+
};
|
417
|
+
version = "3.1.7";
|
418
|
+
};
|
419
|
+
terraform-synthesizer = {
|
420
|
+
dependencies = ["abstract-synthesizer"];
|
421
|
+
groups = ["default"];
|
422
|
+
platforms = [];
|
423
|
+
source = {
|
424
|
+
remotes = ["https://rubygems.org"];
|
425
|
+
sha256 = "1jzv4arl0gp9g7k5b3svwmcxmbyjbxrymw389mz1j9hm60ynb4sm";
|
426
|
+
type = "gem";
|
427
|
+
};
|
428
|
+
version = "0.0.26";
|
429
|
+
};
|
430
|
+
unicode-display_width = {
|
431
|
+
dependencies = ["unicode-emoji"];
|
432
|
+
groups = ["default" "development"];
|
433
|
+
platforms = [];
|
434
|
+
source = {
|
435
|
+
remotes = ["https://rubygems.org"];
|
436
|
+
sha256 = "1has87asspm6m9wgqas8ghhhwyf2i1yqrqgrkv47xw7jq3qjmbwc";
|
437
|
+
type = "gem";
|
438
|
+
};
|
439
|
+
version = "3.1.4";
|
440
|
+
};
|
441
|
+
unicode-emoji = {
|
442
|
+
groups = ["default" "development"];
|
443
|
+
platforms = [];
|
444
|
+
source = {
|
445
|
+
remotes = ["https://rubygems.org"];
|
446
|
+
sha256 = "0ajk6rngypm3chvl6r0vwv36q1931fjqaqhjjya81rakygvlwb1c";
|
447
|
+
type = "gem";
|
448
|
+
};
|
449
|
+
version = "4.0.4";
|
450
|
+
};
|
451
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'terraform-synthesizer'
|
2
|
+
require 'pangea/processor'
|
3
|
+
require 'pangea/renderer'
|
4
|
+
require 'pangea/config'
|
5
|
+
require 'pangea/state'
|
6
|
+
require 'pangea/utils'
|
7
|
+
require 'thor'
|
8
|
+
|
9
|
+
module TheseUtils
|
10
|
+
class << self
|
11
|
+
def cfg
|
12
|
+
@cfg ||= Pangea::Utils.symbolize(
|
13
|
+
Pangea::Config.config
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
def state_init
|
18
|
+
state = Pangea::S3State.new
|
19
|
+
cfg[:namespaces].each_key do |nk|
|
20
|
+
ns_config = cfg[:namespaces][nk]
|
21
|
+
case ns_config[:state][:type].to_sym
|
22
|
+
when :s3
|
23
|
+
bucket_name = ns_config[:state][:config][:bucket]
|
24
|
+
region = ns_config[:state][:config][:region]
|
25
|
+
lock_table_name = ns_config[:state][:config][:lock]
|
26
|
+
|
27
|
+
state.create_bucket(
|
28
|
+
name: bucket_name,
|
29
|
+
region: region
|
30
|
+
)
|
31
|
+
|
32
|
+
state.create_dynamodb_table_for_lock(
|
33
|
+
name: lock_table_name,
|
34
|
+
region: region
|
35
|
+
)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
module Pangea
|
43
|
+
class Cli < Thor
|
44
|
+
desc 'apply FILE', 'apply a FILE of pangea code'
|
45
|
+
def apply(file)
|
46
|
+
Pangea::Processor.register_action('apply')
|
47
|
+
Pangea::Processor.process(File.read(file))
|
48
|
+
end
|
49
|
+
|
50
|
+
desc 'show FILE', 'transpile a FILE of pangea code to json'
|
51
|
+
def show(file)
|
52
|
+
Pangea::Processor.register_action('show')
|
53
|
+
Pangea::Processor.process(File.read(file))
|
54
|
+
end
|
55
|
+
|
56
|
+
desc 'plan FILE', 'plan a FILE of pangea code'
|
57
|
+
def plan(file)
|
58
|
+
Pangea::Processor.register_action('plan')
|
59
|
+
Pangea::Processor.process(File.read(file))
|
60
|
+
end
|
61
|
+
|
62
|
+
desc 'destroy FILE', 'destroy a FILE of pangea code'
|
63
|
+
def destroy(file)
|
64
|
+
Pangea::Processor.register_action('destroy')
|
65
|
+
Pangea::Processor.process(File.read(file))
|
66
|
+
end
|
67
|
+
|
68
|
+
desc 'init', 'initialize an s3 state configuation according to pangea.yml'
|
69
|
+
def init
|
70
|
+
TheseUtils.state_init
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,134 @@
|
|
1
|
+
###############################################################################
|
2
|
+
# modules
|
3
|
+
# module for handling pangea modules
|
4
|
+
# pangea modules are execution units
|
5
|
+
# for terraform code.
|
6
|
+
###############################################################################
|
7
|
+
|
8
|
+
require %(terraform-synthesizer)
|
9
|
+
require %(bundler)
|
10
|
+
|
11
|
+
module PangeaBase
|
12
|
+
BASE_DIR = File.join(
|
13
|
+
Dir.home,
|
14
|
+
%(.pangea)
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
module PangeaRbenv
|
19
|
+
include PangeaBase
|
20
|
+
|
21
|
+
BIN = %(rbenv).freeze
|
22
|
+
|
23
|
+
RBENV_DIR = File.join(
|
24
|
+
BASE_DIR,
|
25
|
+
%(rbenv)
|
26
|
+
)
|
27
|
+
|
28
|
+
VERSIONS_DIR = File.join(
|
29
|
+
RBENV_DIR,
|
30
|
+
%(versions)
|
31
|
+
)
|
32
|
+
|
33
|
+
class << self
|
34
|
+
def versions_dir
|
35
|
+
VERSIONS_DIR
|
36
|
+
end
|
37
|
+
|
38
|
+
def rbenv_installed?
|
39
|
+
`which rbenv`.strip != ''
|
40
|
+
end
|
41
|
+
|
42
|
+
def rbenv_install(version, path)
|
43
|
+
system %(mkdir -p #{VERSIONS_DIR}) unless Dir.exist?(VERSIONS_DIR)
|
44
|
+
if rbenv_installed? && !Dir.exist?(File.join(path.to_s))
|
45
|
+
system [BIN, %(install), version.to_s, path.to_s].join(%( ))
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
module PangeaRubyBuild
|
52
|
+
include PangeaBase
|
53
|
+
BIN = %(ruby-build).freeze
|
54
|
+
RUBY_BUILD_DIR = File.join(
|
55
|
+
BASE_DIR,
|
56
|
+
%(rbenv)
|
57
|
+
)
|
58
|
+
class << self
|
59
|
+
def ruby_build_installed?
|
60
|
+
`which rbenv`.strip != ''
|
61
|
+
end
|
62
|
+
|
63
|
+
def ruby_build(version, path)
|
64
|
+
system %(mkdir -p #{PangeaRbenv.versions_dir}) unless Dir.exist?(PangeaRbenv.versions_dir)
|
65
|
+
system [BIN, version.to_s, path.to_s].join(%( )) if ruby_build_installed? && !Dir.exist?(File.join(path.to_s))
|
66
|
+
end
|
67
|
+
|
68
|
+
def gem_install(gem, ruby_version, gem_version, gemset_path)
|
69
|
+
gem_path = File.join(gemset_path, %(lib), %(ruby), %(gems), ruby_version.to_s, %(gems), %(#{gem}-#{gem_version}))
|
70
|
+
unless Dir.exist?(gem_path)
|
71
|
+
gembin = File.join(gemset_path, %(bin), %(gem))
|
72
|
+
system [gembin, %(install), gem.to_s.strip, %(-v), gem_version.to_s].join(%( ))
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def bundle_install(mpath, gemset_path)
|
77
|
+
@bundlebin = File.join(gemset_path, %(bin), %(bundle))
|
78
|
+
bundlehint = File.join(gemset_path, %(bundle_hint))
|
79
|
+
unless File.exist?(bundlehint)
|
80
|
+
cmd = [
|
81
|
+
# %(cd #{mpath} &&),
|
82
|
+
%(BUNDLE_GEMFILE=#{File.join(mpath, %(Gemfile))}), @bundlebin,
|
83
|
+
%(install)
|
84
|
+
].join(%( ))
|
85
|
+
system cmd
|
86
|
+
system [%(touch), bundlehint].join(%( ))
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
module PangeaModule
|
93
|
+
include PangeaBase
|
94
|
+
|
95
|
+
CACHE_DIR = File.join(
|
96
|
+
BASE_DIR,
|
97
|
+
%(cache)
|
98
|
+
)
|
99
|
+
|
100
|
+
RUBIES_DIR = File.join(
|
101
|
+
BASE_DIR,
|
102
|
+
%(rubies)
|
103
|
+
)
|
104
|
+
|
105
|
+
class << self
|
106
|
+
def symbolize(hash)
|
107
|
+
JSON[JSON[hash], symbolize_names: true]
|
108
|
+
end
|
109
|
+
|
110
|
+
def terraform_synth
|
111
|
+
@terraform_synth ||= TerraformSynthesizer.new
|
112
|
+
end
|
113
|
+
|
114
|
+
# entrypoint for module processing
|
115
|
+
def process(mod)
|
116
|
+
mod = symbolize(mod)
|
117
|
+
|
118
|
+
name = mod.fetch(:name)
|
119
|
+
data = mod.fetch(:data, {})
|
120
|
+
|
121
|
+
raise ArgumentError, %(name cannot be nil) if name.nil?
|
122
|
+
|
123
|
+
# understanding that module entrypoint loading
|
124
|
+
# will work with #{context}-#{name}
|
125
|
+
context = mod.fetch(:context, %(pangea-component))
|
126
|
+
require_name = %(#{context}-#{name})
|
127
|
+
|
128
|
+
require require_name
|
129
|
+
render(data)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
# end modules
|