r10k 3.10.0 → 3.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -10
  3. data/CHANGELOG.mkd +33 -0
  4. data/README.mkd +6 -0
  5. data/doc/dynamic-environments/configuration.mkd +25 -7
  6. data/doc/dynamic-environments/usage.mkd +26 -0
  7. data/doc/puppetfile.mkd +18 -5
  8. data/integration/Rakefile +2 -0
  9. data/integration/tests/basic_functionality/basic_deployment.rb +176 -0
  10. data/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb +15 -13
  11. data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +3 -3
  12. data/integration/tests/user_scenario/complex_workflow/multi_env_remove_re-add.rb +3 -3
  13. data/integration/tests/user_scenario/complex_workflow/multi_env_unamanaged.rb +3 -3
  14. data/lib/r10k/action/base.rb +1 -1
  15. data/lib/r10k/action/deploy/deploy_helpers.rb +4 -0
  16. data/lib/r10k/action/deploy/display.rb +1 -1
  17. data/lib/r10k/action/deploy/environment.rb +19 -9
  18. data/lib/r10k/action/deploy/module.rb +41 -11
  19. data/lib/r10k/action/puppetfile/check.rb +7 -5
  20. data/lib/r10k/action/puppetfile/install.rb +22 -16
  21. data/lib/r10k/action/puppetfile/purge.rb +12 -9
  22. data/lib/r10k/action/runner.rb +40 -4
  23. data/lib/r10k/action/visitor.rb +3 -0
  24. data/lib/r10k/cli/deploy.rb +5 -0
  25. data/lib/r10k/cli/puppetfile.rb +0 -1
  26. data/lib/r10k/content_synchronizer.rb +16 -4
  27. data/lib/r10k/environment/bare.rb +4 -7
  28. data/lib/r10k/environment/base.rb +64 -11
  29. data/lib/r10k/environment/plain.rb +16 -0
  30. data/lib/r10k/environment/with_modules.rb +6 -10
  31. data/lib/r10k/environment.rb +1 -0
  32. data/lib/r10k/errors.rb +5 -0
  33. data/lib/r10k/git/rugged/credentials.rb +77 -0
  34. data/lib/r10k/git/stateful_repository.rb +8 -0
  35. data/lib/r10k/git.rb +3 -0
  36. data/lib/r10k/initializers.rb +14 -7
  37. data/lib/r10k/logging.rb +78 -1
  38. data/lib/r10k/module/base.rb +42 -1
  39. data/lib/r10k/module/definition.rb +64 -0
  40. data/lib/r10k/module/forge.rb +11 -2
  41. data/lib/r10k/module/git.rb +23 -1
  42. data/lib/r10k/module/local.rb +6 -3
  43. data/lib/r10k/module/svn.rb +11 -0
  44. data/lib/r10k/module.rb +20 -2
  45. data/lib/r10k/module_loader/puppetfile/dsl.rb +8 -3
  46. data/lib/r10k/module_loader/puppetfile.rb +109 -28
  47. data/lib/r10k/puppetfile.rb +11 -13
  48. data/lib/r10k/settings/definition.rb +1 -1
  49. data/lib/r10k/settings.rb +89 -1
  50. data/lib/r10k/source/yaml.rb +1 -1
  51. data/lib/r10k/util/purgeable.rb +6 -2
  52. data/lib/r10k/util/setopts.rb +2 -0
  53. data/lib/r10k/util/subprocess.rb +1 -0
  54. data/lib/r10k/version.rb +1 -1
  55. data/locales/r10k.pot +168 -68
  56. data/r10k.gemspec +2 -0
  57. data/r10k.yaml.example +28 -0
  58. data/spec/fixtures/unit/action/r10k_logging.yaml +12 -0
  59. data/spec/fixtures/unit/puppetfile/forge-override/Puppetfile +8 -0
  60. data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile +10 -0
  61. data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile.new +10 -0
  62. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/managed_symlink_file +1 -0
  63. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/{managed_subdir_2 → subdir_allowlisted_2}/ignored_1 +0 -0
  64. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/unmanaged_symlink_dir +1 -0
  65. data/spec/fixtures/unit/util/purgeable/managed_one/managed_symlink_dir +1 -0
  66. data/spec/fixtures/unit/util/purgeable/managed_one/unmanaged_symlink_file +1 -0
  67. data/spec/integration/util/purageable_spec.rb +41 -0
  68. data/spec/r10k-mocks/mock_env.rb +3 -0
  69. data/spec/r10k-mocks/mock_source.rb +7 -3
  70. data/spec/unit/action/deploy/environment_spec.rb +96 -30
  71. data/spec/unit/action/deploy/module_spec.rb +217 -51
  72. data/spec/unit/action/puppetfile/check_spec.rb +17 -5
  73. data/spec/unit/action/puppetfile/install_spec.rb +42 -36
  74. data/spec/unit/action/puppetfile/purge_spec.rb +15 -17
  75. data/spec/unit/action/runner_spec.rb +132 -9
  76. data/spec/unit/environment/bare_spec.rb +13 -0
  77. data/spec/unit/environment/base_spec.rb +30 -17
  78. data/spec/unit/environment/git_spec.rb +2 -2
  79. data/spec/unit/environment/plain_spec.rb +8 -0
  80. data/spec/unit/environment/svn_spec.rb +4 -3
  81. data/spec/unit/environment/with_modules_spec.rb +3 -2
  82. data/spec/unit/git/rugged/credentials_spec.rb +29 -0
  83. data/spec/unit/git/stateful_repository_spec.rb +5 -0
  84. data/spec/unit/module/base_spec.rb +54 -8
  85. data/spec/unit/module/forge_spec.rb +51 -4
  86. data/spec/unit/module/git_spec.rb +67 -9
  87. data/spec/unit/module/svn_spec.rb +35 -5
  88. data/spec/unit/module_loader/puppetfile_spec.rb +108 -33
  89. data/spec/unit/module_spec.rb +12 -1
  90. data/spec/unit/puppetfile_spec.rb +33 -3
  91. data/spec/unit/settings_spec.rb +43 -2
  92. data/spec/unit/util/purgeable_spec.rb +22 -11
  93. metadata +31 -3
data/locales/r10k.pot CHANGED
@@ -6,11 +6,11 @@
6
6
  #, fuzzy
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: r10k 3.9.3-10-gfedc81a\n"
9
+ "Project-Id-Version: r10k 3.9.3-134-g9f93336f\n"
10
10
  "\n"
11
11
  "Report-Msgid-Bugs-To: docs@puppetlabs.com\n"
12
- "POT-Creation-Date: 2021-07-07 21:13+0000\n"
13
- "PO-Revision-Date: 2021-07-07 21:13+0000\n"
12
+ "POT-Creation-Date: 2021-10-25 18:18+0000\n"
13
+ "PO-Revision-Date: 2021-10-25 18:18+0000\n"
14
14
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15
15
  "Language-Team: LANGUAGE <LL@li.org>\n"
16
16
  "Language: \n"
@@ -19,71 +19,83 @@ msgstr ""
19
19
  "Content-Transfer-Encoding: 8bit\n"
20
20
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
21
21
 
22
- #: ../lib/r10k/action/deploy/deploy_helpers.rb:12 ../lib/r10k/settings/loader.rb:63
22
+ #: ../lib/r10k/action/deploy/deploy_helpers.rb:16 ../lib/r10k/settings/loader.rb:63
23
23
  msgid "No configuration file given, no config file found in current directory, and no global config present"
24
24
  msgstr ""
25
25
 
26
- #: ../lib/r10k/action/deploy/deploy_helpers.rb:26
26
+ #: ../lib/r10k/action/deploy/deploy_helpers.rb:30
27
27
  msgid "Making changes to deployed environments has been administratively disabled."
28
28
  msgstr ""
29
29
 
30
- #: ../lib/r10k/action/deploy/deploy_helpers.rb:27
30
+ #: ../lib/r10k/action/deploy/deploy_helpers.rb:31
31
31
  msgid "Reason: %{write_lock}"
32
32
  msgstr ""
33
33
 
34
- #: ../lib/r10k/action/deploy/environment.rb:112
34
+ #: ../lib/r10k/action/deploy/environment.rb:116
35
35
  msgid "Environment(s) \\'%{environments}\\' cannot be found in any source and will not be deployed."
36
36
  msgstr ""
37
37
 
38
- #: ../lib/r10k/action/deploy/environment.rb:145
38
+ #: ../lib/r10k/action/deploy/environment.rb:136
39
+ msgid "Executing postrun command."
40
+ msgstr ""
41
+
42
+ #: ../lib/r10k/action/deploy/environment.rb:150
39
43
  msgid "Environment %{env_dir} does not match environment name filter, skipping"
40
44
  msgstr ""
41
45
 
42
- #: ../lib/r10k/action/deploy/environment.rb:153
46
+ #: ../lib/r10k/action/deploy/environment.rb:158
43
47
  msgid "Deploying environment %{env_path}"
44
48
  msgstr ""
45
49
 
46
- #: ../lib/r10k/action/deploy/environment.rb:156
50
+ #: ../lib/r10k/action/deploy/environment.rb:161
47
51
  msgid "Environment %{env_dir} is now at %{env_signature}"
48
52
  msgstr ""
49
53
 
50
- #: ../lib/r10k/action/deploy/environment.rb:160
54
+ #: ../lib/r10k/action/deploy/environment.rb:165
51
55
  msgid "Environment %{env_dir} is new, updating all modules"
52
56
  msgstr ""
53
57
 
54
58
  #: ../lib/r10k/action/deploy/module.rb:81
59
+ msgid "Running postrun command for environments: %{envs_to_run}."
60
+ msgstr ""
61
+
62
+ #: ../lib/r10k/action/deploy/module.rb:91
63
+ msgid "No environments were modified, not executing postrun command."
64
+ msgstr ""
65
+
66
+ #: ../lib/r10k/action/deploy/module.rb:103
55
67
  msgid "Only updating modules in environment(s) %{opt_env} skipping environment %{env_path}"
56
68
  msgstr ""
57
69
 
58
- #: ../lib/r10k/action/deploy/module.rb:83
70
+ #: ../lib/r10k/action/deploy/module.rb:105
59
71
  msgid "Updating modules %{modules} in environment %{env_path}"
60
72
  msgstr ""
61
73
 
62
- #: ../lib/r10k/action/puppetfile/check.rb:16
74
+ #: ../lib/r10k/action/puppetfile/check.rb:18
63
75
  msgid "Syntax OK"
64
76
  msgstr ""
65
77
 
66
- #: ../lib/r10k/action/runner.rb:54 ../lib/r10k/deployment/config.rb:42
78
+ #: ../lib/r10k/action/runner.rb:57 ../lib/r10k/deployment/config.rb:42
67
79
  msgid "Overriding config file setting '%{key}': '%{old_val}' -> '%{new_val}'"
68
80
  msgstr ""
69
81
 
70
- #: ../lib/r10k/action/runner.rb:91
82
+ #: ../lib/r10k/action/runner.rb:99
71
83
  msgid "Reading configuration from %{config_path}"
72
84
  msgstr ""
73
85
 
74
- #: ../lib/r10k/action/runner.rb:94
86
+ #: ../lib/r10k/action/runner.rb:102
75
87
  msgid "No config file explicitly given and no default config file could be found, default settings will be used."
76
88
  msgstr ""
77
89
 
78
- #: ../lib/r10k/content_synchronizer.rb:27
90
+ #: ../lib/r10k/content_synchronizer.rb:33
79
91
  msgid "Updating modules with %{pool_size} threads"
80
92
  msgstr ""
81
93
 
82
- #: ../lib/r10k/content_synchronizer.rb:37
94
+ #: ../lib/r10k/content_synchronizer.rb:46
83
95
  msgid "Error during concurrent deploy of a module: %{message}"
84
96
  msgstr ""
85
97
 
86
- #: ../lib/r10k/content_synchronizer.rb:75
98
+ #: ../lib/r10k/content_synchronizer.rb:87
87
99
  msgid "Module thread %{id} exiting: %{message}"
88
100
  msgstr ""
89
101
 
@@ -95,7 +107,11 @@ msgstr ""
95
107
  msgid "Unable to load sources; the supplied configuration does not define the 'sources' key"
96
108
  msgstr ""
97
109
 
98
- #: ../lib/r10k/environment/base.rb:68 ../lib/r10k/environment/base.rb:84 ../lib/r10k/environment/base.rb:93 ../lib/r10k/source/base.rb:83
110
+ #: ../lib/r10k/environment/bare.rb:6
111
+ msgid "\"bare\" environment type is deprecated; please use \"plain\" instead (environment: %{name})"
112
+ msgstr ""
113
+
114
+ #: ../lib/r10k/environment/base.rb:89 ../lib/r10k/environment/base.rb:105 ../lib/r10k/environment/base.rb:114 ../lib/r10k/source/base.rb:83
99
115
  msgid "%{class} has not implemented method %{method}"
100
116
  msgstr ""
101
117
 
@@ -103,15 +119,15 @@ msgstr ""
103
119
  msgid "Improper configuration value given for strip_component setting in %{src} source. Value must be a string, a /regex/, false, or omitted. Got \"%{val}\" (%{type})"
104
120
  msgstr ""
105
121
 
106
- #: ../lib/r10k/environment/with_modules.rb:57
122
+ #: ../lib/r10k/environment/with_modules.rb:60
107
123
  msgid "Environment and %{src} both define the \"%{name}\" module"
108
124
  msgstr ""
109
125
 
110
- #: ../lib/r10k/environment/with_modules.rb:58
126
+ #: ../lib/r10k/environment/with_modules.rb:61
111
127
  msgid "#{msg_error}. The %{src} definition will be ignored"
112
128
  msgstr ""
113
129
 
114
- #: ../lib/r10k/environment/with_modules.rb:68
130
+ #: ../lib/r10k/environment/with_modules.rb:71
115
131
  msgid "Unexpected value for `module_conflicts` setting in %{env} environment: %{val}"
116
132
  msgstr ""
117
133
 
@@ -207,54 +223,106 @@ msgstr ""
207
223
  msgid "Rugged versions prior to 0.24.0 do not support pruning stale branches during fetch, please upgrade your \\'rugged\\' gem. (Current version is: %{version})"
208
224
  msgstr ""
209
225
 
210
- #: ../lib/r10k/git/rugged/credentials.rb:24
226
+ #: ../lib/r10k/git/rugged/credentials.rb:28
211
227
  msgid "Authentication failed for Git remote %{url}."
212
228
  msgstr ""
213
229
 
214
- #: ../lib/r10k/git/rugged/credentials.rb:48
230
+ #: ../lib/r10k/git/rugged/credentials.rb:52
215
231
  msgid "Using per-repository private key %{key} for URL %{url}"
216
232
  msgstr ""
217
233
 
218
- #: ../lib/r10k/git/rugged/credentials.rb:51
234
+ #: ../lib/r10k/git/rugged/credentials.rb:55
219
235
  msgid "URL %{url} has no per-repository private key using '%{key}'."
220
236
  msgstr ""
221
237
 
222
- #: ../lib/r10k/git/rugged/credentials.rb:53
238
+ #: ../lib/r10k/git/rugged/credentials.rb:57
223
239
  msgid "Git remote %{url} uses the SSH protocol but no private key was given"
224
240
  msgstr ""
225
241
 
226
- #: ../lib/r10k/git/rugged/credentials.rb:57
242
+ #: ../lib/r10k/git/rugged/credentials.rb:61
227
243
  msgid "Unable to use SSH key auth for %{url}: private key %{private_key} is missing or unreadable"
228
244
  msgstr ""
229
245
 
230
- #: ../lib/r10k/git/rugged/credentials.rb:84
246
+ #: ../lib/r10k/git/rugged/credentials.rb:102
231
247
  msgid "Using OAuth token from stdin for URL %{url}"
232
248
  msgstr ""
233
249
 
234
- #: ../lib/r10k/git/rugged/credentials.rb:87
250
+ #: ../lib/r10k/git/rugged/credentials.rb:105
235
251
  msgid "Using OAuth token from %{token_path} for URL %{url}"
236
252
  msgstr ""
237
253
 
238
- #: ../lib/r10k/git/rugged/credentials.rb:89
254
+ #: ../lib/r10k/git/rugged/credentials.rb:107
239
255
  msgid "%{path} is missing or unreadable, cannot load OAuth token"
240
256
  msgstr ""
241
257
 
242
- #: ../lib/r10k/git/rugged/credentials.rb:93
258
+ #: ../lib/r10k/git/rugged/credentials.rb:111
243
259
  msgid "Supplied OAuth token contains invalid characters."
244
260
  msgstr ""
245
261
 
246
- #: ../lib/r10k/git/rugged/credentials.rb:117
262
+ #: ../lib/r10k/git/rugged/credentials.rb:135
247
263
  msgid "URL %{url} includes the username %{username}, using that user for authentication."
248
264
  msgstr ""
249
265
 
250
- #: ../lib/r10k/git/rugged/credentials.rb:120
266
+ #: ../lib/r10k/git/rugged/credentials.rb:138
251
267
  msgid "URL %{url} did not specify a user, using %{user} from configuration"
252
268
  msgstr ""
253
269
 
254
- #: ../lib/r10k/git/rugged/credentials.rb:123
270
+ #: ../lib/r10k/git/rugged/credentials.rb:141
255
271
  msgid "URL %{url} did not specify a user, using current user %{user}"
256
272
  msgstr ""
257
273
 
274
+ #: ../lib/r10k/git/rugged/credentials.rb:148
275
+ msgid "Github App id contains invalid characters."
276
+ msgstr ""
277
+
278
+ #: ../lib/r10k/git/rugged/credentials.rb:149
279
+ msgid "Github App token ttl contains invalid characters."
280
+ msgstr ""
281
+
282
+ #: ../lib/r10k/git/rugged/credentials.rb:150
283
+ msgid "Github App key is missing or unreadable"
284
+ msgstr ""
285
+
286
+ #: ../lib/r10k/git/rugged/credentials.rb:155
287
+ msgid "Github App key is not a valid SSL private key"
288
+ msgstr ""
289
+
290
+ #: ../lib/r10k/git/rugged/credentials.rb:158
291
+ msgid "Github App key is not a valid SSL key"
292
+ msgstr ""
293
+
294
+ #: ../lib/r10k/git/rugged/credentials.rb:161
295
+ msgid "Using Github App id %{app_id} with SSL key from %{key_path}"
296
+ msgstr ""
297
+
298
+ #: ../lib/r10k/git/rugged/credentials.rb:178
299
+ msgid ""
300
+ "Unexpected response code: #{get_response.code}\n"
301
+ "Response body: #{get_response.body}"
302
+ msgstr ""
303
+
304
+ #: ../lib/r10k/git/rugged/credentials.rb:179
305
+ msgid "Error using private key to get Github App access token from url"
306
+ msgstr ""
307
+
308
+ #: ../lib/r10k/git/rugged/credentials.rb:194
309
+ msgid ""
310
+ "Unexpected response code: #{post_response.code}\n"
311
+ "Response body: #{post_response.body}"
312
+ msgstr ""
313
+
314
+ #: ../lib/r10k/git/rugged/credentials.rb:195
315
+ msgid "Error using private key to generate access token from #{access_token_url}"
316
+ msgstr ""
317
+
318
+ #: ../lib/r10k/git/rugged/credentials.rb:200
319
+ msgid "Github App token contains invalid characters."
320
+ msgstr ""
321
+
322
+ #: ../lib/r10k/git/rugged/credentials.rb:202
323
+ msgid "Github App token generated, expires at: %{expire}"
324
+ msgstr ""
325
+
258
326
  #: ../lib/r10k/git/rugged/thin_repository.rb:85 ../lib/r10k/git/shellgit/thin_repository.rb:65
259
327
  msgid "Updated repo %{path} to include alternate object db path %{objects_dir}"
260
328
  msgstr ""
@@ -271,31 +339,31 @@ msgstr ""
271
339
  msgid "Found local modifications in %{file_path}"
272
340
  msgstr ""
273
341
 
274
- #: ../lib/r10k/git/stateful_repository.rb:44
342
+ #: ../lib/r10k/git/stateful_repository.rb:45
275
343
  msgid "Unable to sync repo to unresolvable ref '%{ref}'"
276
344
  msgstr ""
277
345
 
278
- #: ../lib/r10k/git/stateful_repository.rb:51
346
+ #: ../lib/r10k/git/stateful_repository.rb:53
279
347
  msgid "Cloning %{repo_path} and checking out %{ref}"
280
348
  msgstr ""
281
349
 
282
- #: ../lib/r10k/git/stateful_repository.rb:54
350
+ #: ../lib/r10k/git/stateful_repository.rb:56
283
351
  msgid "Replacing %{repo_path} and checking out %{ref}"
284
352
  msgstr ""
285
353
 
286
- #: ../lib/r10k/git/stateful_repository.rb:58 ../lib/r10k/git/stateful_repository.rb:63
354
+ #: ../lib/r10k/git/stateful_repository.rb:60 ../lib/r10k/git/stateful_repository.rb:65
287
355
  msgid "Updating %{repo_path} to %{ref}"
288
356
  msgstr ""
289
357
 
290
- #: ../lib/r10k/git/stateful_repository.rb:62
358
+ #: ../lib/r10k/git/stateful_repository.rb:64
291
359
  msgid "Overwriting local modifications to %{repo_path}"
292
360
  msgstr ""
293
361
 
294
- #: ../lib/r10k/git/stateful_repository.rb:66
362
+ #: ../lib/r10k/git/stateful_repository.rb:68
295
363
  msgid "Skipping %{repo_path} due to local modifications"
296
364
  msgstr ""
297
365
 
298
- #: ../lib/r10k/git/stateful_repository.rb:69
366
+ #: ../lib/r10k/git/stateful_repository.rb:72
299
367
  msgid "%{repo_path} is already at Git ref %{ref}"
300
368
  msgstr ""
301
369
 
@@ -315,39 +383,55 @@ msgstr ""
315
383
  msgid "Invalid log level '%{val}'. Valid levels are %{log_levels}"
316
384
  msgstr ""
317
385
 
318
- #: ../lib/r10k/module.rb:29
386
+ #: ../lib/r10k/module.rb:45
319
387
  msgid "Module %{name} with args %{args} doesn't have an implementation. (Are you using the right arguments?)"
320
388
  msgstr ""
321
389
 
322
- #: ../lib/r10k/module/base.rb:75
390
+ #: ../lib/r10k/module/base.rb:83
391
+ msgid "Spec dir for #{@title} will not be deleted because it is not in the moduledir"
392
+ msgstr ""
393
+
394
+ #: ../lib/r10k/module/base.rb:95
395
+ msgid "Deleting spec data at #{spec_path}"
396
+ msgstr ""
397
+
398
+ #: ../lib/r10k/module/base.rb:103
399
+ msgid "No spec dir detected at #{spec_path}, skipping deletion"
400
+ msgstr ""
401
+
402
+ #: ../lib/r10k/module/base.rb:116
323
403
  msgid "Deploying module to %{path}"
324
404
  msgstr ""
325
405
 
326
- #: ../lib/r10k/module/base.rb:78
406
+ #: ../lib/r10k/module/base.rb:119
327
407
  msgid "Only updating modules %{modules}, skipping module %{name}"
328
408
  msgstr ""
329
409
 
330
- #: ../lib/r10k/module/base.rb:134
410
+ #: ../lib/r10k/module/base.rb:175
331
411
  msgid "Module name (%{title}) must match either 'modulename' or 'owner/modulename'"
332
412
  msgstr ""
333
413
 
334
- #: ../lib/r10k/module/forge.rb:89
414
+ #: ../lib/r10k/module/definition.rb:28
415
+ msgid "Not updating module %{name}, assuming content unchanged"
416
+ msgstr ""
417
+
418
+ #: ../lib/r10k/module/forge.rb:98
335
419
  msgid "The module %{title} does not appear to have any published releases, cannot determine latest version."
336
420
  msgstr ""
337
421
 
338
- #: ../lib/r10k/module/forge.rb:92 ../lib/r10k/module/forge.rb:121
422
+ #: ../lib/r10k/module/forge.rb:101 ../lib/r10k/module/forge.rb:130
339
423
  msgid "The module %{title} does not exist on %{url}."
340
424
  msgstr ""
341
425
 
342
- #: ../lib/r10k/module/forge.rb:196
426
+ #: ../lib/r10k/module/forge.rb:205
343
427
  msgid "Forge module names must match 'owner/modulename', instead got #{title}"
344
428
  msgstr ""
345
429
 
346
- #: ../lib/r10k/module/git.rb:66
430
+ #: ../lib/r10k/module/git.rb:81
347
431
  msgid "Cannot track control repo branch for content '%{name}' when not part of a git-backed environment, will use default if available."
348
432
  msgstr ""
349
433
 
350
- #: ../lib/r10k/module/local.rb:35
434
+ #: ../lib/r10k/module/local.rb:37
351
435
  msgid "Module %{title} is a local module, always indicating synced."
352
436
  msgstr ""
353
437
 
@@ -355,27 +439,43 @@ msgstr ""
355
439
  msgid "Could not read metadata.json"
356
440
  msgstr ""
357
441
 
358
- #: ../lib/r10k/puppetfile.rb:73
442
+ #: ../lib/r10k/module_loader/puppetfile.rb:62
359
443
  msgid "Using Puppetfile '%{puppetfile}'"
360
444
  msgstr ""
361
445
 
362
- #: ../lib/r10k/puppetfile.rb:87
363
- msgid "Puppetfile %{path} missing or unreadable"
446
+ #: ../lib/r10k/module_loader/puppetfile.rb:63
447
+ msgid "Using moduledir '%{moduledir}'"
364
448
  msgstr ""
365
449
 
366
- #: ../lib/r10k/puppetfile.rb:100
450
+ #: ../lib/r10k/module_loader/puppetfile.rb:84
367
451
  msgid "Failed to evaluate %{path}"
368
452
  msgstr ""
369
453
 
370
- #: ../lib/r10k/puppetfile.rb:114
454
+ #: ../lib/r10k/module_loader/puppetfile.rb:101
455
+ msgid "Unable to preload Puppetfile because of %{msg}"
456
+ msgstr ""
457
+
458
+ #: ../lib/r10k/module_loader/puppetfile.rb:119
459
+ msgid "Using Forge from Puppetfile: %{forge}"
460
+ msgstr ""
461
+
462
+ #: ../lib/r10k/module_loader/puppetfile.rb:122
463
+ msgid "Ignoring Forge declaration in Puppetfile, using value from settings: %{forge}."
464
+ msgstr ""
465
+
466
+ #: ../lib/r10k/module_loader/puppetfile.rb:183 ../lib/r10k/puppetfile.rb:104
467
+ msgid "Puppetfile %{path} missing or unreadable"
468
+ msgstr ""
469
+
470
+ #: ../lib/r10k/module_loader/puppetfile.rb:219
371
471
  msgid "Puppetfiles cannot contain duplicate module names."
372
472
  msgstr ""
373
473
 
374
- #: ../lib/r10k/puppetfile.rb:116
474
+ #: ../lib/r10k/module_loader/puppetfile.rb:221
375
475
  msgid "Remove the duplicates of the following modules: %{dupes}"
376
476
  msgstr ""
377
477
 
378
- #: ../lib/r10k/puppetfile.rb:285
478
+ #: ../lib/r10k/module_loader/puppetfile/dsl.rb:37
379
479
  msgid "unrecognized declaration '%{method}'"
380
480
  msgstr ""
381
481
 
@@ -522,45 +622,45 @@ msgstr ""
522
622
  msgid "pe_license feature is not available, PE only Puppet modules will not be downloadable."
523
623
  msgstr ""
524
624
 
525
- #: ../lib/r10k/util/purgeable.rb:87
625
+ #: ../lib/r10k/util/purgeable.rb:91
526
626
  msgid "Not purging %{path} due to internal exclusion match: %{exclusion_match}"
527
627
  msgstr ""
528
628
 
529
- #: ../lib/r10k/util/purgeable.rb:89
629
+ #: ../lib/r10k/util/purgeable.rb:93
530
630
  msgid "Not purging %{path} due to whitelist match: %{allowlist_match}"
531
631
  msgstr ""
532
632
 
533
- #: ../lib/r10k/util/purgeable.rb:133
633
+ #: ../lib/r10k/util/purgeable.rb:137
534
634
  msgid "No unmanaged contents in %{managed_dirs}, nothing to purge"
535
635
  msgstr ""
536
636
 
537
- #: ../lib/r10k/util/purgeable.rb:138
637
+ #: ../lib/r10k/util/purgeable.rb:142
538
638
  msgid "Removing unmanaged path %{path}"
539
639
  msgstr ""
540
640
 
541
- #: ../lib/r10k/util/purgeable.rb:143
641
+ #: ../lib/r10k/util/purgeable.rb:147
542
642
  msgid "Unable to remove unmanaged path: %{path}"
543
643
  msgstr ""
544
644
 
545
- #: ../lib/r10k/util/setopts.rb:58
645
+ #: ../lib/r10k/util/setopts.rb:60
546
646
  msgid "%{class_name} parameters '%{a}' and '%{b}' conflict. Specify one or the other, but not both"
547
647
  msgstr ""
548
648
 
549
- #: ../lib/r10k/util/setopts.rb:65
649
+ #: ../lib/r10k/util/setopts.rb:67
550
650
  msgid "%{class_name} cannot handle option '%{key}'"
551
651
  msgstr ""
552
652
 
553
- #: ../lib/r10k/util/subprocess.rb:69
653
+ #: ../lib/r10k/util/subprocess.rb:70
554
654
  msgid "Starting process: %{args}"
555
655
  msgstr ""
556
656
 
557
- #: ../lib/r10k/util/subprocess.rb:74
657
+ #: ../lib/r10k/util/subprocess.rb:75
558
658
  msgid ""
559
659
  "Finished process:\n"
560
660
  "%{result}"
561
661
  msgstr ""
562
662
 
563
- #: ../lib/r10k/util/subprocess.rb:77
663
+ #: ../lib/r10k/util/subprocess.rb:78
564
664
  msgid "Command exited with non-zero exit code"
565
665
  msgstr ""
566
666
 
data/r10k.gemspec CHANGED
@@ -36,6 +36,8 @@ Gem::Specification.new do |s|
36
36
  s.add_dependency 'fast_gettext', '~> 1.1.0'
37
37
  s.add_dependency 'gettext', ['>= 3.0.2', '< 3.3.0']
38
38
 
39
+ s.add_dependency 'jwt', '~> 2.2.3'
40
+
39
41
  s.add_development_dependency 'rspec', '~> 3.1'
40
42
 
41
43
  s.add_development_dependency 'rake'
data/r10k.yaml.example CHANGED
@@ -110,3 +110,31 @@ forge:
110
110
  # The 'baseurl' setting indicates where Forge modules should be installed
111
111
  # from. This defaults to 'https://forgeapi.puppetlabs.com'
112
112
  #baseurl: 'https://forgemirror.example.com'
113
+
114
+ # Configuration options on how R10k should log its actions
115
+ logging:
116
+ # The 'level' setting sets the default log level to run R10k actions at.
117
+ # This value will be overridden by any value set through the command line.
118
+ #level: warn
119
+
120
+ # Specify additional log outputs here, any log4r outputter can be used.
121
+ # If no log level is specified then the output will use the global level.
122
+ #outputs:
123
+ # - type: file
124
+ # level: debug
125
+ # parameters:
126
+ # filename: /var/log/r10k.log
127
+ # trunc: true
128
+ # - type: syslog
129
+ # - type: email
130
+ # only_at: [fatal]
131
+ # parameters:
132
+ # from: r10k@example.com
133
+ # to: sysadmins@example.com
134
+ # server: smtp.example.com
135
+ # subject: Fatal R10k error occurred
136
+
137
+ # The 'disable_default_stderr' setting specifies if the default output on
138
+ # stderr should be active or not, in case R10k is to be run entirely
139
+ # through scripts or cronjobs where console output is unwelcome.
140
+ #disable_default_stderr: false
@@ -0,0 +1,12 @@
1
+ ---
2
+ logging:
3
+ level: FATAL
4
+
5
+ outputs:
6
+ - type: file
7
+ parameters:
8
+ filename: r10k.log
9
+
10
+ - type: syslog
11
+
12
+ disable_default_stderr: true
@@ -0,0 +1,8 @@
1
+ forge "my.custom.forge.com"
2
+
3
+ mod "puppetlabs/stdlib", '4.12.0'
4
+ mod "puppetlabs/concat", '2.1.0'
5
+
6
+ mod 'apache',
7
+ :git => 'https://github.com/puppetlabs/puppetlabs-apache',
8
+ :branch => 'docs_experiment'
@@ -0,0 +1,10 @@
1
+ mod 'puppetlabs/apt', '2.1.1'
2
+ mod 'puppetlabs/stdlib', :latest
3
+ mod 'puppetlabs/concat'
4
+ mod 'puppetlabs/rpm', '2.1.1-pre1'
5
+ mod 'foo', git: 'this/remote', branch: 'main'
6
+ mod 'bar', git: 'this/remote', tag: 'v1.2.3'
7
+ mod 'baz', git: 'this/remote', commit: '123abc456'
8
+ mod 'fizz', git: 'this/remote', ref: '1234567890abcdef1234567890abcdef12345678'
9
+ mod 'buzz', git: 'this/remote', ref: 'refs/heads/main'
10
+ mod 'canary', local: true
@@ -0,0 +1,10 @@
1
+ mod 'puppetlabs/apt', '3.0.0'
2
+ mod 'puppetlabs/stdlib', :latest
3
+ mod 'puppetlabs/concat'
4
+ mod 'puppetlabs/rpm', '2.1.1-pre1'
5
+ mod 'foo', git: 'this/remote', branch: 'main'
6
+ mod 'bar', git: 'this/remote', tag: 'v1.2.3'
7
+ mod 'baz', git: 'this/remote', commit: '123abc456'
8
+ mod 'fizz', git: 'this/remote', ref: '1234567890abcdef1234567890abcdef12345678'
9
+ mod 'buzz', git: 'this/remote', ref: 'refs/heads/main'
10
+ mod 'canary', local: true
@@ -0,0 +1 @@
1
+ spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1
@@ -0,0 +1 @@
1
+ spec/fixtures/unit/util/purgeable/managed_one/expected_1
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+ require 'r10k/util/purgeable'
3
+ require 'r10k/util/cleaner'
4
+
5
+ require 'tmpdir'
6
+
7
+ RSpec.describe R10K::Util::Purgeable do
8
+ it 'purges only unmanaged files' do
9
+ Dir.mktmpdir do |envdir|
10
+ managed_directory = "#{envdir}/managed_one"
11
+ desired_contents = [
12
+ "#{managed_directory}/expected_1",
13
+ "#{managed_directory}/managed_subdir_1",
14
+ "#{managed_directory}/managed_symlink_dir",
15
+ "#{managed_directory}/managed_subdir_1/subdir_expected_1",
16
+ "#{managed_directory}/managed_subdir_1/managed_symlink_file",
17
+ ]
18
+
19
+ FileUtils.cp_r('spec/fixtures/unit/util/purgeable/managed_one/',
20
+ managed_directory)
21
+
22
+ cleaner = R10K::Util::Cleaner.new([managed_directory], desired_contents)
23
+
24
+ cleaner.purge!({ recurse: true, whitelist: ["**/subdir_allowlisted_2"] })
25
+
26
+ # Files present after purge
27
+ expect(File.exist?("#{managed_directory}/expected_1")).to be true
28
+ expect(File.exist?("#{managed_directory}/managed_subdir_1")).to be true
29
+ expect(File.exist?("#{managed_directory}/managed_symlink_dir")).to be true
30
+ expect(File.exist?("#{managed_directory}/managed_subdir_1/subdir_expected_1")).to be true
31
+ expect(File.exist?("#{managed_directory}/managed_subdir_1/managed_symlink_file")).to be true
32
+ expect(File.exist?("#{managed_directory}/managed_subdir_1/subdir_allowlisted_2")).to be true
33
+
34
+ # Purged files
35
+ expect(File.exist?("#{managed_directory}/unmanaged_1")).to be false
36
+ expect(File.exist?("#{managed_directory}/managed_subdir_1/unmanaged_symlink_dir")).to be false
37
+ expect(File.exist?("#{managed_directory}/unmanaged_symlink_file")).to be false
38
+ expect(File.exist?("#{managed_directory}/managed_subdir_1/subdir_unmanaged_1")).to be false
39
+ end
40
+ end
41
+ end
@@ -1,6 +1,9 @@
1
1
  require 'r10k/environment'
2
+ require 'r10k/util/purgeable'
2
3
 
3
4
  class R10K::Environment::Mock < R10K::Environment::Base
5
+ include R10K::Util::Purgeable
6
+
4
7
  def sync
5
8
  "synced"
6
9
  end
@@ -5,9 +5,13 @@ class R10K::Source::Mock < R10K::Source::Base
5
5
  R10K::Source.register(:mock, self)
6
6
 
7
7
  def environments
8
- corrected_environment_names = @options[:environments].map do |env|
9
- R10K::Environment::Name.new(env, :prefix => @prefix, :invalid => 'correct_and_warn')
8
+ if @_environments.nil?
9
+ corrected_environment_names = @options[:environments].map do |env|
10
+ R10K::Environment::Name.new(env, :prefix => @prefix, :invalid => 'correct_and_warn')
11
+ end
12
+ @_environments = corrected_environment_names.map { |env| R10K::Environment::Mock.new(env.name, @basedir, env.dirname, { overrides: @options[:overrides] }) }
10
13
  end
11
- corrected_environment_names.map { |env| R10K::Environment::Mock.new(env.name, @basedir, env.dirname, { overrides: @options[:overrides] }) }
14
+
15
+ @_environments
12
16
  end
13
17
  end