simp-metadata 0.4.4 → 0.5.2

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 (61) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +494 -0
  3. data/Rakefile +19 -22
  4. data/exe/simp-install +1 -1
  5. data/exe/simp-media +1 -1
  6. data/exe/simp-metadata +1 -1
  7. data/lib/simp/install/command.rb +34 -35
  8. data/lib/simp/media.rb +0 -1
  9. data/lib/simp/media/command.rb +34 -35
  10. data/lib/simp/media/engine.rb +29 -35
  11. data/lib/simp/media/type.rb +1 -2
  12. data/lib/simp/media/type/base.rb +12 -4
  13. data/lib/simp/media/type/control-repo.rb +96 -107
  14. data/lib/simp/media/type/internet.rb +8 -8
  15. data/lib/simp/media/type/iso.rb +0 -1
  16. data/lib/simp/media/type/local.rb +18 -19
  17. data/lib/simp/media/type/tar.rb +37 -37
  18. data/lib/simp/metadata.rb +240 -258
  19. data/lib/simp/metadata/bootstrap_source.rb +93 -89
  20. data/lib/simp/metadata/buildinfo.rb +23 -23
  21. data/lib/simp/metadata/command.rb +60 -58
  22. data/lib/simp/metadata/commands.rb +1 -1
  23. data/lib/simp/metadata/commands/base.rb +28 -25
  24. data/lib/simp/metadata/commands/clone.rb +3 -5
  25. data/lib/simp/metadata/commands/component.rb +128 -90
  26. data/lib/simp/metadata/commands/delete.rb +4 -5
  27. data/lib/simp/metadata/commands/pry.rb +1 -3
  28. data/lib/simp/metadata/commands/release.rb +22 -23
  29. data/lib/simp/metadata/commands/releases.rb +1 -3
  30. data/lib/simp/metadata/commands/save.rb +10 -13
  31. data/lib/simp/metadata/commands/script.rb +11 -14
  32. data/lib/simp/metadata/commands/search.rb +15 -20
  33. data/lib/simp/metadata/commands/set-write-url.rb +1 -3
  34. data/lib/simp/metadata/commands/set-write.rb +1 -3
  35. data/lib/simp/metadata/commands/update.rb +9 -10
  36. data/lib/simp/metadata/component.rb +310 -154
  37. data/lib/simp/metadata/components.rb +15 -16
  38. data/lib/simp/metadata/engine.rb +31 -39
  39. data/lib/simp/metadata/fake_uri.rb +2 -0
  40. data/lib/simp/metadata/location.rb +99 -105
  41. data/lib/simp/metadata/locations.rb +19 -21
  42. data/lib/simp/metadata/release.rb +30 -39
  43. data/lib/simp/metadata/releases.rb +14 -15
  44. data/lib/simp/metadata/source.rb +69 -79
  45. data/lib/simp/metadata/version.rb +9 -0
  46. data/spec/simp/media/command_spec.rb +4 -5
  47. data/spec/simp/media/engine_spec.rb +14 -14
  48. data/spec/simp/media/type/control_repo_spec.rb +10 -12
  49. data/spec/simp/media/type/internet_spec.rb +11 -11
  50. data/spec/simp/media/type/iso_spec.rb +6 -7
  51. data/spec/simp/media/type/local_spec.rb +6 -8
  52. data/spec/simp/media/type/tar_spec.rb +6 -8
  53. data/spec/simp/metadata/buildinfo_spec.rb +19 -17
  54. data/spec/simp/metadata/commands/clone_spec.rb +4 -3
  55. data/spec/simp/metadata/component_spec.rb +43 -54
  56. data/spec/simp/metadata/engine_spec.rb +38 -41
  57. data/spec/simp/metadata/release_spec.rb +72 -79
  58. data/spec/simp/metadata/source_spec.rb +8 -6
  59. data/spec/simp/metadata_spec.rb +95 -98
  60. data/spec/spec_helper.rb +33 -21
  61. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 787ec71ba309fd25a0db84b65e7b4df6d21c0d8d
4
- data.tar.gz: 58bfa532d6dfb01909e1964b5ae159a784ffcb12
2
+ SHA256:
3
+ metadata.gz: 6bec880fc1d3eb1dbeeeca61855155cf4000d9b5a381cb2cb76c77d6585fb3bd
4
+ data.tar.gz: 4e5536c319838d8fc3eeef7a7be23a46c0d55568d8f5b24e4831214d0a148ee5
5
5
  SHA512:
6
- metadata.gz: a0cb0bd18113057d09f7578825318e088952b88648d172f1e11d5ce04324f17b16578de2f509f539ece9b20c28d2faeab7bb99ad3a58bf5413f3cbb8277b73ac
7
- data.tar.gz: b9816ccae3dc61765b03a0c91a0d29c71b8cde57de39c65f98b6ee8d4751273d5b2355457cc5691282f15a85f9add84d0efc00007e77112f31841c834eefddf0
6
+ metadata.gz: 938e43f4ad4718f87ae86b123eb0406cced1a6432c51baf1accbf2996a4594f2261f813109dfa88fbf770a1947aa153dbbe7c49b7c8060817db360d2fcc4f923
7
+ data.tar.gz: 8489605639a7e0e828c44b31bf591777b7051cf1772a322f402a586426df62c3b7d536b0e3df821f189c2a337f6aacc74acc00a7b9f58ffc199987bea8704f76
data/README.md CHANGED
@@ -0,0 +1,494 @@
1
+ # SIMP-METADATA Tool
2
+
3
+ The simp-metadata tool is a powerful multi-use tool that utilizes the simp-metadata database. This tool can perform
4
+ multiple actions, including searches, comparisons, downloads, and builds.
5
+
6
+ ## Component Command
7
+
8
+ The `component` command is used with the following subcommands:
9
+ * view
10
+ * diff
11
+ * download
12
+ * build
13
+ * create(Permission restricted)
14
+ * update(Permission restricted)
15
+
16
+ Notes:
17
+ * All options require a setting, i.e `-v 6.2.0-RC1` to specify you want to use the 6.2.0-RC1 version of SIMP.
18
+ * By default, unless SIMP version is a required argument, it will default to use the latest, unstable component list.
19
+ * Versions are case sensitive, so `6.2.0-rc1` will not return results, you must enter `6.2.0-RC1`
20
+
21
+ ***
22
+
23
+ #### Component View
24
+
25
+ The `simp-metadata component view` command is used to view the details of a specific component for a release.
26
+ All output from the `simp-metadata component view` command is formatted in hiera.
27
+
28
+ ##### Syntax:
29
+
30
+ `simp-metadata component view [-v <release>] <component> [attribute]`
31
+
32
+ ##### Examples:
33
+
34
+ ###### Command:
35
+
36
+ `simp-metadata component view -v 6.1.0-0 puppet-grafana`
37
+
38
+ ###### Output:
39
+
40
+ ```
41
+ ---
42
+ component_type: puppet-module
43
+ authoritative: 'false'
44
+ asset_name: grafana
45
+ extension: tgz
46
+ module_name: grafana
47
+ url: https://github.com/simp/puppet-grafana
48
+ method: git
49
+ extract: 'false'
50
+ ref: 6d426d5ccc52ff23dbbcfc45290dafd224b5d2bc
51
+ version: 6d426d5ccc52ff23dbbcfc45290dafd224b5d2bc
52
+ release_source: simp-metadata
53
+ component_source: simp-metadata
54
+ location:
55
+ extract: 'false'
56
+ primary: 'true'
57
+ method: git
58
+ url: https://github.com/simp/puppet-grafana
59
+ ```
60
+
61
+ ###### Command:
62
+
63
+ `simp-metadata component view -v 6.1.0-0 pupmod-simp-rsync version`
64
+
65
+ ###### Output:
66
+
67
+ ```
68
+ ---
69
+ version: 6.0.2
70
+ ```
71
+
72
+ ***
73
+
74
+ #### Component Diff
75
+
76
+ The `simp-metadata component diff` command is used to view the difference between component attributes from one release
77
+ to another. This command is formatted without using `-v`(or unstable by default) to specify a release, but by using two
78
+ required arguments. An attribute can be specified, or the diff command will output all differences by default.
79
+ As with the previous command, the output is in hiera format.
80
+
81
+ ##### Syntax:
82
+
83
+ `simp-metadata component diff <release 1> <release 2> <component> [attribute]`
84
+
85
+ ##### Examples:
86
+
87
+ ###### Command:
88
+
89
+ `simp-metadata component diff 6.1.0-0 6.2.0-RC1 pupmod-simp-rsyslog`
90
+
91
+ ###### Output:
92
+
93
+ ```
94
+ ---
95
+ branch:
96
+ original: ''
97
+ changed: master
98
+ tag:
99
+ original: 7.0.2
100
+ changed: 7.2.0
101
+ ref:
102
+ original: 14f0ef46df315121c0e136281ac124c57aaf7b91
103
+ changed: 74d6139036748257e451db316189cfe117360eb4
104
+ version:
105
+ original: 7.0.2
106
+ changed: 7.2.0
107
+ ```
108
+
109
+ ###### Command:
110
+
111
+ `simp-metadata component diff 6.1.0-0 6.2.0-RC1 pupmod-simp-rsyslog version`
112
+
113
+ ###### Output:
114
+
115
+ ```
116
+ ---
117
+ version:
118
+ original: 7.0.2
119
+ changed: 7.2.0
120
+ ```
121
+
122
+ ***
123
+
124
+ #### Component Download
125
+
126
+ The `simp-metadata component download` command is used to download a specified component from a release.
127
+
128
+ ##### Syntax:
129
+
130
+ `simp-metadata component download [-v <release>] [-d <destination>] [-s <source>] component`
131
+
132
+ ##### Examples:
133
+
134
+ ###### Command:
135
+
136
+ `simp-metadata component download -v 6.2.0-RC1 -d ./rpms puppet-grafana`
137
+
138
+ ###### Output:
139
+ ```
140
+ Copied pupmod-puppet-grafana-4.1.1-0.noarch.rpm from https://download.simp-project.com/simp/yum/simp6/el/7/x86_64
141
+ simp-metadata@example> ls ./rpms
142
+ pupmod-puppet-grafana-4.1.1-0.noarch.rpm
143
+ ```
144
+
145
+ ***
146
+
147
+ #### Component Build
148
+
149
+ The `simp-metadata component build` command is used to build a specified RPM, based on the passed component name
150
+ and version.
151
+
152
+ ##### Syntax:
153
+
154
+ `simp-metadata component build [-v <release>]`
155
+
156
+ ##### Examples:
157
+
158
+ ###### Command:
159
+
160
+ `simp-metadata component build -v 6.2.0-RC1 -d ./rpms puppet-grafana`
161
+
162
+ ###### Output:
163
+ ```
164
+ Cloning into 'source'...
165
+ remote: Counting objects: 483, done.
166
+ remote: Total 483 (delta 0), reused 0 (delta 0), pack-reused 483
167
+ Receiving objects: 100% (483/483), 111.81 KiB | 5.32 MiB/s, done.
168
+ Resolving deltas: 100% (219/219), done.
169
+ Note: checking out '6.0.6'.
170
+
171
+ You are in 'detached HEAD' state. You can look around, make experimental
172
+ changes and commit them, and you can discard any commits you make in this
173
+ state without impacting any branches by performing another checkout.
174
+
175
+ If you want to create a new branch to retain commits you create, you may
176
+ do so (now or later) by using -b with the checkout command again. Example:
177
+
178
+ git checkout -b <new-branch-name>
179
+
180
+ HEAD is now at b3534c8... (SIMP-4951) travis.yml missing 'on:' tag in puppetforge deploy provider (#45)
181
+ RPM pupmod-simp-rsync-6.0.6-0.noarch.rpm built successfully
182
+ <simp-metadata@example> ls ./rpms
183
+ pupmod-puppet-grafana-4.1.1-0.noarch.rpm pupmod-simp-rsync-6.0.6-0.noarch.rpm
184
+ ```
185
+
186
+ Any RPMs that are build will be unsigned, but contain all normal build info for SIMP:
187
+ ```
188
+ simp-metadata@example> rpm -qpi pupmod-simp-rsync-6.0.6-0.noarch.rpm
189
+ Name : pupmod-simp-rsync
190
+ Version : 6.0.6
191
+ Release : 0
192
+ Architecture: noarch
193
+ Install Date: (not installed)
194
+ Group : Applications/System
195
+ Size : 84120
196
+ License : Apache-2.0
197
+ Signature : (none)
198
+ Source RPM : pupmod-simp-rsync-6.0.6-0.src.rpm
199
+ Build Date : Fri 31 Aug 2018 03:05:30 PM EDT
200
+ Relocations : usr/share/simp/modules
201
+ Packager : info@onyxpoint.com
202
+ Vendor : Onyx Point, Inc
203
+ URL : https://github.com/simp/pupmod-simp-rsync
204
+ Summary : Rsync Puppet Module
205
+ Description :
206
+ manage and rsync server, secured by stunnel
207
+ ```
208
+
209
+ ***
210
+
211
+ #### Component Create (Permission required)
212
+
213
+ The `simp-metadata component create` command is used to create a new component in the releases .yaml in simp-metadata.
214
+
215
+ ##### Syntax:
216
+
217
+ `simp-metadata component create <component_name> name=<value>`
218
+
219
+ ***
220
+
221
+ #### Component Update (Permission required)
222
+
223
+ The `simp-metadata component update` is used to update a specific attribute on a component.
224
+
225
+ ##### Syntax:
226
+ `simp-metadata component update <component_name> <attribute> <value>`
227
+
228
+ ***
229
+
230
+ ## Release Command
231
+
232
+ The `release` command has the following optional subcommands:
233
+ * components
234
+ * diff
235
+ * puppetfile
236
+
237
+ #### Release
238
+
239
+ By default the release command will output a formatted list of components with the header 'components:' at the top
240
+ based on the release given.
241
+
242
+ ##### Syntax:
243
+
244
+ `simp-metadata release [-v <release>]`
245
+
246
+ ##### Example:
247
+
248
+ ###### Command:
249
+
250
+ `simp-metadata release -v 6.2.0-RC1`
251
+
252
+ ###### Output:
253
+
254
+ ```
255
+ components:
256
+ simp-metadata
257
+ simp-core
258
+ simp-doc
259
+ pupmod-simp-rsync
260
+ simp-rsync_skeleton
261
+ simp-adapter
262
+ simp-environment
263
+
264
+ ...
265
+ ```
266
+
267
+ ***
268
+
269
+ #### Release Components
270
+
271
+ The `components` subcommand will remove the 'components:' leading line. This is to allow for easier use of piping
272
+ and variable assignment.
273
+
274
+ ##### Syntax:
275
+
276
+ `simp-metadata release components [-v <release>]`
277
+
278
+ ##### Example:
279
+
280
+ ###### Command:
281
+
282
+ `simp-metadata release components -v 6.2.0-RC1`
283
+
284
+ ###### Output:
285
+
286
+ ```
287
+ simp-metadata
288
+ simp-core
289
+ simp-doc
290
+ pupmod-simp-rsync
291
+ simp-rsync_skeleton
292
+ simp-adapter
293
+ simp-environment
294
+
295
+ ...
296
+ ```
297
+
298
+ ***
299
+
300
+ #### Release Diff
301
+
302
+ The `diff` subcommand is used to compare the difference between two releases. This has an optional `attribute` setting
303
+ to narrow down the diff, but by default will return all differences. As with some of the component subcommands,
304
+ the output is in hiera format.
305
+
306
+ ##### Syntax:
307
+
308
+ `simp-metadata release diff <release 1> <release 2> [attribute]`
309
+
310
+ ##### Examples:
311
+
312
+ ###### Command:
313
+
314
+ `simp-metadata release diff 6.1.0-0 6.2.0-RC1`
315
+
316
+ ###### Output:
317
+
318
+ ```
319
+ ---
320
+ pupmod-simp-site:
321
+ branch:
322
+ original: ''
323
+ changed: master
324
+ tag:
325
+ original: 2.0.3
326
+ changed: 2.0.4
327
+ ref:
328
+ original: 61327ae260572365cab6f778cd78f7769aa0d16e
329
+ changed: 0ba070f208ce5965ff0e701d286df55ab6806fd6
330
+ version:
331
+ original: 2.0.3
332
+ changed: 2.0.4
333
+ pupmod-simp-ssh:
334
+ branch:
335
+ original: ''
336
+ changed: master
337
+ tag:
338
+ original: 6.1.0
339
+ changed: 6.4.3
340
+ ref:
341
+ original: 2ff26a6690be2fdbd9e68210bcaf5f4cdc9088bc
342
+ changed: 22a817680126e3ff9cd2497fbe6d3ebf92722730
343
+ version:
344
+ original: 6.1.0
345
+ changed: 6.4.3
346
+
347
+ ...
348
+ ```
349
+
350
+ ###### Command:
351
+
352
+ `simp-metadata release diff 6.1.0-0 6.2.0-RC1 version`
353
+
354
+ ###### Output:
355
+
356
+ ```
357
+ ---
358
+ puppetlabs-apache:
359
+ version:
360
+ original: 1.11.0
361
+ changed: 3.0.0
362
+ puppetlabs-concat:
363
+ version:
364
+ original: simp6.0.0-2.2.0
365
+ changed: 4.1.1
366
+ puppetlabs-inifile:
367
+ version:
368
+ original: simp6.0.0-1.6.0
369
+ changed: 2.2.0
370
+ puppetlabs-java:
371
+ version:
372
+ original: simp-1.6.0-post1
373
+ changed: 2.4.0
374
+ puppetlabs-motd:
375
+ version:
376
+ original: simp6.0.0-1.4.0
377
+ changed: 1.9.0
378
+ puppetlabs-mysql:
379
+ version:
380
+ original: simp6.0.0-3.10.0
381
+ changed: 5.3.0
382
+
383
+ ...
384
+ ```
385
+
386
+ ***
387
+
388
+ #### Release Puppetfile
389
+
390
+ The `puppetfile` subcommand is used to create a Puppetfile based on a releases .yaml file. This subcommand has an
391
+ optional `simp-core` argument that will format the Puppetfile for use with simp-core.
392
+
393
+ ##### Syntax:
394
+
395
+ `simp-metadata release puppetfile [-v <release>] [simp-core]`
396
+
397
+ ##### Examples:
398
+
399
+ ###### Command:
400
+
401
+ `simp-metadata release -v 6.2.0-RC1 puppetfile simp-core > Puppetfile`
402
+
403
+ ###### Result:
404
+
405
+ This will create a simp-core style Puppetfile with sections for moduledirs 'src', 'src/assets', and
406
+ 'src/puppet/modules'.
407
+
408
+ ```
409
+ moduledir 'src'
410
+
411
+ mod 'simp-doc',
412
+ :git => 'https://github.com/simp/simp-doc',
413
+ :ref => 'dfdd6a349526280922d5d81a82e743330c73dd38'
414
+
415
+ moduledir 'src/assets'
416
+
417
+ mod 'simp-rsync_skeleton',
418
+ :git => 'https://github.com/simp/simp-rsync-skeleton',
419
+ :ref => 'aaf439407429acd8a1f07d9f7505eb232a8bcd62'
420
+
421
+ mod 'simp-adapter',
422
+ :git => 'https://github.com/simp/simp-adapter',
423
+ :ref => 'c1cb4e2cc03bc9bed0f828d4bf30fcb46b540216'
424
+
425
+ mod 'simp-environment',
426
+ :git => 'https://github.com/simp/simp-environment-skeleton',
427
+ :ref => '86ffad13755cd6e5e97a4de683a1a1a967d50854'
428
+
429
+ ...
430
+
431
+ moduledir 'src/puppet/modules'
432
+
433
+ mod 'simp-rsync',
434
+ :git => 'https://github.com/simp/pupmod-simp-rsync',
435
+ :ref => 'b3534c8eb35d9dd527e6459a54277feb8d614f80'
436
+
437
+ mod 'puppet-grafana',
438
+ :git => 'https://github.com/simp/puppet-grafana',
439
+ :ref => '9ccb9bbe66cb44118ebbc9f91ab2a5c99440dbe3'
440
+
441
+ mod 'camptocamp-kmod',
442
+ :git => 'https://github.com/simp/puppet-kmod',
443
+ :ref => '7c17b7dbc4fbf1f63f6bae197acdbab78f7f12fd'
444
+
445
+ mod 'elastic-elasticsearch',
446
+ :git => 'https://github.com/simp/puppet-elasticsearch',
447
+ :ref => '7d297e0002f1519e488620b7580963c80fe89f18'
448
+
449
+ ...
450
+ ```
451
+
452
+ ###### Command:
453
+
454
+ `simp-metadata release -v 6.2.0-RC1 puppetfile > Puppetfile`
455
+
456
+ ###### Output:
457
+
458
+ This will create a Puppetfile without the moduledir sections.
459
+
460
+ ```
461
+ mod 'simp-rsync',
462
+ :git => 'https://github.com/simp/pupmod-simp-rsync',
463
+ :ref => 'b3534c8eb35d9dd527e6459a54277feb8d614f80'
464
+
465
+ mod 'puppet-grafana',
466
+ :git => 'https://github.com/simp/puppet-grafana',
467
+ :ref => '9ccb9bbe66cb44118ebbc9f91ab2a5c99440dbe3'
468
+
469
+ mod 'camptocamp-kmod',
470
+ :git => 'https://github.com/simp/puppet-kmod',
471
+ :ref => '7c17b7dbc4fbf1f63f6bae197acdbab78f7f12fd'
472
+
473
+ mod 'elastic-elasticsearch',
474
+ :git => 'https://github.com/simp/puppet-elasticsearch',
475
+ :ref => '7d297e0002f1519e488620b7580963c80fe89f18'
476
+
477
+ mod 'elastic-logstash',
478
+ :git => 'https://github.com/simp/puppet-logstash',
479
+ :ref => '212439a83fa900f0212095a84a420e49d9788fc7'
480
+
481
+ mod 'herculesteam-augeasproviders_apache',
482
+ :git => 'https://github.com/simp/augeasproviders_apache',
483
+ :ref => '4e9ff96f1fc919fb96e59d03a3180bcb70c9cf65'
484
+
485
+ mod 'herculesteam-augeasproviders_core',
486
+ :git => 'https://github.com/simp/augeasproviders_core',
487
+ :ref => '604680cb5fe7e32fd1ad1051fc34ef100a4d6923'
488
+
489
+ mod 'herculesteam-augeasproviders_grub',
490
+ :git => 'https://github.com/simp/augeasproviders_grub',
491
+ :ref => 'aa550a1b1df303eb2a07b80634f5e83b5ad718b8'
492
+
493
+ ...
494
+ ```