r10k 3.11.0 → 3.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.mkd +9 -0
  3. data/doc/dynamic-environments/configuration.mkd +7 -3
  4. data/doc/dynamic-environments/usage.mkd +26 -0
  5. data/doc/puppetfile.mkd +3 -4
  6. data/integration/tests/basic_functionality/basic_deployment.rb +176 -0
  7. data/lib/r10k/action/deploy/environment.rb +8 -1
  8. data/lib/r10k/action/deploy/module.rb +11 -6
  9. data/lib/r10k/action/puppetfile/check.rb +7 -5
  10. data/lib/r10k/action/puppetfile/install.rb +22 -16
  11. data/lib/r10k/action/puppetfile/purge.rb +12 -9
  12. data/lib/r10k/cli/deploy.rb +1 -0
  13. data/lib/r10k/cli/puppetfile.rb +0 -1
  14. data/lib/r10k/content_synchronizer.rb +16 -4
  15. data/lib/r10k/environment/base.rb +64 -11
  16. data/lib/r10k/environment/with_modules.rb +6 -10
  17. data/lib/r10k/git/stateful_repository.rb +7 -0
  18. data/lib/r10k/initializers.rb +1 -7
  19. data/lib/r10k/module/base.rb +5 -1
  20. data/lib/r10k/module/definition.rb +64 -0
  21. data/lib/r10k/module/forge.rb +10 -2
  22. data/lib/r10k/module/git.rb +22 -1
  23. data/lib/r10k/module/local.rb +2 -3
  24. data/lib/r10k/module/svn.rb +10 -0
  25. data/lib/r10k/module.rb +20 -2
  26. data/lib/r10k/module_loader/puppetfile/dsl.rb +8 -3
  27. data/lib/r10k/module_loader/puppetfile.rb +95 -29
  28. data/lib/r10k/puppetfile.rb +1 -2
  29. data/lib/r10k/settings.rb +11 -0
  30. data/lib/r10k/version.rb +1 -1
  31. data/locales/r10k.pot +75 -47
  32. data/spec/fixtures/unit/puppetfile/forge-override/Puppetfile +8 -0
  33. data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile +9 -0
  34. data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile.new +9 -0
  35. data/spec/r10k-mocks/mock_env.rb +3 -0
  36. data/spec/r10k-mocks/mock_source.rb +7 -3
  37. data/spec/unit/action/deploy/environment_spec.rb +80 -30
  38. data/spec/unit/action/deploy/module_spec.rb +50 -62
  39. data/spec/unit/action/puppetfile/check_spec.rb +17 -5
  40. data/spec/unit/action/puppetfile/install_spec.rb +42 -36
  41. data/spec/unit/action/puppetfile/purge_spec.rb +15 -17
  42. data/spec/unit/action/runner_spec.rb +0 -8
  43. data/spec/unit/environment/base_spec.rb +30 -17
  44. data/spec/unit/environment/git_spec.rb +2 -2
  45. data/spec/unit/environment/svn_spec.rb +4 -3
  46. data/spec/unit/environment/with_modules_spec.rb +2 -1
  47. data/spec/unit/module/base_spec.rb +8 -8
  48. data/spec/unit/module/forge_spec.rb +32 -4
  49. data/spec/unit/module/git_spec.rb +51 -10
  50. data/spec/unit/module/svn_spec.rb +18 -6
  51. data/spec/unit/module_loader/puppetfile_spec.rb +90 -30
  52. data/spec/unit/puppetfile_spec.rb +2 -2
  53. data/spec/unit/settings_spec.rb +25 -2
  54. metadata +7 -2
@@ -90,6 +90,27 @@ describe R10K::Settings do
90
90
  end
91
91
  end
92
92
  end
93
+
94
+ describe "allow_puppetfile_override" do
95
+ it 'is false by default' do
96
+ expect(subject.evaluate({})[:allow_puppetfile_override]).to eq(false)
97
+ end
98
+
99
+ it 'can be set to true' do
100
+ expect(subject.evaluate({"allow_puppetfile_override" => true})[:allow_puppetfile_override]).to eq(true)
101
+ end
102
+
103
+ it "raises an error for non-boolean values" do
104
+ expect {
105
+ subject.evaluate({"allow_puppetfile_override" => 'invalid_string'})
106
+ }.to raise_error do |err|
107
+ expect(err.message).to match(/Validation failed for 'forge' settings group/)
108
+ expect(err.errors.size).to eq 1
109
+ expect(err.errors[:allow_puppetfile_override]).to be_a_kind_of(ArgumentError)
110
+ expect(err.errors[:allow_puppetfile_override].message).to match(/`allow_puppetfile_override` can only be a boolean value, not 'invalid_string'/)
111
+ end
112
+ end
113
+ end
93
114
  end
94
115
 
95
116
  describe "deploy settings" do
@@ -270,10 +291,12 @@ describe R10K::Settings do
270
291
  it "passes settings through to the forge settings" do
271
292
  output = subject.evaluate("forge" => {"baseurl" => "https://forge.tessier-ashpool.freeside",
272
293
  "proxy" => "https://proxy.tessier-ashpool.freesize:3128",
273
- "authorization_token" => "faketoken"})
294
+ "authorization_token" => "faketoken",
295
+ "allow_puppetfile_override" => true})
274
296
  expect(output[:forge]).to eq(:baseurl => "https://forge.tessier-ashpool.freeside",
275
297
  :proxy => "https://proxy.tessier-ashpool.freesize:3128",
276
- :authorization_token => "faketoken")
298
+ :authorization_token => "faketoken",
299
+ :allow_puppetfile_override => true)
277
300
  end
278
301
  end
279
302
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r10k
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.0
4
+ version: 3.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Thebo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-17 00:00:00.000000000 Z
11
+ date: 2021-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored2
@@ -277,6 +277,7 @@ files:
277
277
  - integration/tests/Puppetfile/HTTP_PROXY_affects_forge_source.rb
278
278
  - integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb
279
279
  - integration/tests/README.mkd
280
+ - integration/tests/basic_functionality/basic_deployment.rb
280
281
  - integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb
281
282
  - integration/tests/basic_functionality/negative/neg_deploy_with_invalid_r10k_yaml.rb
282
283
  - integration/tests/basic_functionality/negative/neg_deploy_with_missing_r10k_yaml.rb
@@ -402,6 +403,7 @@ files:
402
403
  - lib/r10k/logging/terminaloutputter.rb
403
404
  - lib/r10k/module.rb
404
405
  - lib/r10k/module/base.rb
406
+ - lib/r10k/module/definition.rb
405
407
  - lib/r10k/module/forge.rb
406
408
  - lib/r10k/module/git.rb
407
409
  - lib/r10k/module/local.rb
@@ -469,11 +471,14 @@ files:
469
471
  - spec/fixtures/unit/puppetfile/argument-error/Puppetfile
470
472
  - spec/fixtures/unit/puppetfile/default-branch-override/Puppetfile
471
473
  - spec/fixtures/unit/puppetfile/duplicate-module-error/Puppetfile
474
+ - spec/fixtures/unit/puppetfile/forge-override/Puppetfile
472
475
  - spec/fixtures/unit/puppetfile/invalid-syntax/Puppetfile
473
476
  - spec/fixtures/unit/puppetfile/load-error/Puppetfile
474
477
  - spec/fixtures/unit/puppetfile/name-error/Puppetfile
475
478
  - spec/fixtures/unit/puppetfile/valid-forge-with-version/Puppetfile
476
479
  - spec/fixtures/unit/puppetfile/valid-forge-without-version/Puppetfile
480
+ - spec/fixtures/unit/puppetfile/various-modules/Puppetfile
481
+ - spec/fixtures/unit/puppetfile/various-modules/Puppetfile.new
477
482
  - spec/fixtures/unit/util/purgeable/managed_one/expected_1
478
483
  - spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/managed_subdir_2/ignored_1
479
484
  - spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_expected_1