r10k 2.6.9 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.travis.yml +9 -16
  4. data/CHANGELOG.mkd +23 -36
  5. data/Gemfile +2 -1
  6. data/MAINTAINERS +18 -0
  7. data/README.mkd +1 -5
  8. data/bin/r10k +2 -2
  9. data/doc/common-patterns.mkd +2 -2
  10. data/doc/dynamic-environments/configuration.mkd +1 -2
  11. data/doc/dynamic-environments/quickstart.mkd +3 -3
  12. data/doc/dynamic-environments/usage.mkd +0 -12
  13. data/doc/puppetfile.mkd +0 -18
  14. data/docker/Gemfile +13 -0
  15. data/docker/ci/build +72 -0
  16. data/docker/distelli-manifest.yml +4 -0
  17. data/docker/r10k/Dockerfile +41 -0
  18. data/docker/r10k/spec/dockerfile_spec.rb +16 -0
  19. data/integration/Gemfile +4 -2
  20. data/integration/Rakefile +3 -2
  21. data/integration/pre-suite/00_pe_install.rb +0 -1
  22. data/integration/pre-suite/30_test_utils.rb +17 -0
  23. data/integration/scripts/README.mkd +86 -0
  24. data/integration/scripts/setup_r10k_env_centos5.sh +23 -0
  25. data/integration/scripts/setup_r10k_env_centos6.sh +23 -0
  26. data/integration/scripts/setup_r10k_env_rhel7.sh +23 -0
  27. data/integration/scripts/setup_r10k_env_sles11.sh +23 -0
  28. data/integration/scripts/setup_r10k_env_sles12.sh +23 -0
  29. data/integration/scripts/setup_r10k_env_ubuntu1004.sh +23 -0
  30. data/integration/scripts/setup_r10k_env_ubuntu1204.sh +23 -0
  31. data/integration/scripts/setup_r10k_env_ubuntu1404.sh +23 -0
  32. data/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb +2 -2
  33. data/integration/tests/basic_functionality/negative/attempt_to_install_peonly_module_without_license.rb +71 -0
  34. data/integration/tests/basic_functionality/proxy_with_pe_only_module.rb +2 -2
  35. data/integration/tests/git_source/HTTP_proxy_and_git_source.rb +2 -2
  36. data/integration/tests/i18n/deploy_module_with_unicode_in_file_name.rb +64 -0
  37. data/integration/tests/purging/does_not_purge_files_on_white_list.rb +93 -0
  38. data/integration/tests/purging/invalid_whitelist_types.rb +63 -0
  39. data/integration/tests/user_scenario/basic_workflow/negative/neg_disk_full.rb +12 -2
  40. data/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +1 -8
  41. data/integration/tests/user_scenario/basic_workflow/single_env_10000_files.rb +11 -2
  42. data/integration/tests/user_scenario/basic_workflow/single_env_large_files.rb +12 -2
  43. data/lib/r10k/action/deploy/environment.rb +2 -15
  44. data/lib/r10k/action/puppetfile/check.rb +1 -1
  45. data/lib/r10k/action/puppetfile/cri_runner.rb +1 -13
  46. data/lib/r10k/action/puppetfile/purge.rb +1 -1
  47. data/lib/r10k/cli/deploy.rb +0 -1
  48. data/lib/r10k/cli/puppetfile.rb +4 -0
  49. data/lib/r10k/environment/base.rb +7 -1
  50. data/lib/r10k/environment/svn.rb +1 -1
  51. data/lib/r10k/forge/module_release.rb +2 -2
  52. data/lib/r10k/git/rugged/base_repository.rb +6 -3
  53. data/lib/r10k/git/rugged/working_repository.rb +10 -1
  54. data/lib/r10k/git/shellgit/base_repository.rb +27 -8
  55. data/lib/r10k/git/shellgit/working_repository.rb +20 -6
  56. data/lib/r10k/git/stateful_repository.rb +0 -1
  57. data/lib/r10k/module/git.rb +0 -5
  58. data/lib/r10k/puppetfile.rb +22 -27
  59. data/lib/r10k/source/base.rb +6 -0
  60. data/lib/r10k/source/git.rb +2 -2
  61. data/lib/r10k/source/svn.rb +4 -2
  62. data/lib/r10k/util/purgeable.rb +4 -2
  63. data/lib/r10k/util/subprocess/runner/posix.rb +3 -3
  64. data/lib/r10k/version.rb +1 -4
  65. data/locales/r10k.pot +23 -19
  66. data/r10k.gemspec +4 -8
  67. data/r10k.yaml.example +6 -0
  68. data/spec/fixtures/unit/puppetfile/duplicate-module-error/Puppetfile +10 -0
  69. data/spec/fixtures/unit/puppetfile/name-error/Puppetfile +1 -0
  70. data/spec/shared-examples/git/working_repository.rb +46 -0
  71. data/spec/unit/action/deploy/environment_spec.rb +0 -63
  72. data/spec/unit/action/puppetfile/check_spec.rb +24 -9
  73. data/spec/unit/action/puppetfile/cri_runner_spec.rb +2 -20
  74. data/spec/unit/action/puppetfile/install_spec.rb +16 -16
  75. data/spec/unit/action/puppetfile/purge_spec.rb +29 -6
  76. data/spec/unit/forge/module_release_spec.rb +10 -6
  77. data/spec/unit/git/stateful_repository_spec.rb +1 -4
  78. data/spec/unit/puppetfile_spec.rb +43 -36
  79. metadata +33 -48
  80. data/.github/pull_request_template.md +0 -4
  81. data/.github/workflows/release.yml +0 -36
  82. data/CODEOWNERS +0 -1
  83. data/spec/fixtures/unit/puppetfile/default-branch-override/Puppetfile +0 -5
@@ -1,6 +1,25 @@
1
1
  require 'spec_helper'
2
2
  require 'r10k/puppetfile'
3
3
 
4
+ describe R10K::Puppetfile do
5
+
6
+ subject do
7
+ described_class.new(
8
+ '/some/nonexistent/basedir',
9
+ nil,
10
+ nil,
11
+ 'Puppetfile.r10k'
12
+ )
13
+ end
14
+
15
+ describe "a custom puppetfile Puppetfile.r10k" do
16
+ it "is the basedir joined with '/Puppetfile.r10k' path" do
17
+ expect(subject.puppetfile_path).to eq '/some/nonexistent/basedir/Puppetfile.r10k'
18
+ end
19
+ end
20
+
21
+ end
22
+
4
23
  describe R10K::Puppetfile do
5
24
 
6
25
  subject do
@@ -15,6 +34,13 @@ describe R10K::Puppetfile do
15
34
  end
16
35
  end
17
36
 
37
+ describe "the default puppetfile" do
38
+ it "is the basedir joined with '/Puppetfile' path" do
39
+ expect(subject.puppetfile_path).to eq '/some/nonexistent/basedir/Puppetfile'
40
+ end
41
+ end
42
+
43
+
18
44
  describe "setting moduledir" do
19
45
  it "changes to given moduledir if it is an absolute path" do
20
46
  subject.set_moduledir('/absolute/path/moduledir')
@@ -128,26 +154,6 @@ describe R10K::Puppetfile do
128
154
  end
129
155
  end
130
156
 
131
- describe '#managed_directories' do
132
- it 'returns an array of paths that can be purged' do
133
- allow(R10K::Module).to receive(:new).with('puppet/test_module', subject.moduledir, '1.2.3', anything).and_call_original
134
-
135
- subject.add_module('puppet/test_module', '1.2.3')
136
- expect(subject.managed_directories).to match_array(["/some/nonexistent/basedir/modules"])
137
- end
138
-
139
- context 'with a module with install_path == \'\'' do
140
- it 'basedir isn\'t in the list of paths to purge' do
141
- module_opts = { install_path: '', git: 'git@example.com:puppet/test_module.git' }
142
-
143
- allow(R10K::Module).to receive(:new).with('puppet/test_module', subject.basedir, module_opts, anything).and_call_original
144
-
145
- subject.add_module('puppet/test_module', module_opts)
146
- expect(subject.managed_directories).to be_empty
147
- end
148
- end
149
- end
150
-
151
157
  describe "evaluating a Puppetfile" do
152
158
  def expect_wrapped_error(orig, pf_path, wrapped_error)
153
159
  expect(orig).to be_a_kind_of(R10K::Error)
@@ -188,37 +194,38 @@ describe R10K::Puppetfile do
188
194
  end
189
195
  end
190
196
 
191
- it "accepts a forge module with a version" do
192
- path = File.join(PROJECT_ROOT, 'spec', 'fixtures', 'unit', 'puppetfile', 'valid-forge-with-version')
197
+ it "rejects Puppetfiles with duplicate module names" do
198
+ path = File.join(PROJECT_ROOT, 'spec', 'fixtures', 'unit', 'puppetfile', 'duplicate-module-error')
193
199
  pf_path = File.join(path, 'Puppetfile')
194
200
  subject = described_class.new(path)
195
- expect { subject.load! }.not_to raise_error
201
+ expect {
202
+ subject.load!
203
+ }.to raise_error(R10K::Error, /Puppetfiles cannot contain duplicate module names/i)
196
204
  end
197
205
 
198
- it "accepts a forge module without a version" do
199
- path = File.join(PROJECT_ROOT, 'spec', 'fixtures', 'unit', 'puppetfile', 'valid-forge-without-version')
206
+ it "wraps and re-raises name errors" do
207
+ path = File.join(PROJECT_ROOT, 'spec', 'fixtures', 'unit', 'puppetfile', 'name-error')
200
208
  pf_path = File.join(path, 'Puppetfile')
201
209
  subject = described_class.new(path)
202
- expect { subject.load! }.not_to raise_error
210
+ expect {
211
+ subject.load!
212
+ }.to raise_error do |e|
213
+ expect_wrapped_error(e, pf_path, NameError)
214
+ end
203
215
  end
204
216
 
205
- it "creates a git module and applies the default branch sepcified in the Puppetfile" do
206
- path = File.join(PROJECT_ROOT, 'spec', 'fixtures', 'unit', 'puppetfile', 'default-branch-override')
217
+ it "accepts a forge module with a version" do
218
+ path = File.join(PROJECT_ROOT, 'spec', 'fixtures', 'unit', 'puppetfile', 'valid-forge-with-version')
207
219
  pf_path = File.join(path, 'Puppetfile')
208
220
  subject = described_class.new(path)
209
221
  expect { subject.load! }.not_to raise_error
210
- git_module = subject.modules[0]
211
- expect(git_module.default_ref).to eq 'here_lies_the_default_branch'
212
222
  end
213
223
 
214
- it "creates a git module and applies the provided default_branch_override" do
215
- path = File.join(PROJECT_ROOT, 'spec', 'fixtures', 'unit', 'puppetfile', 'default-branch-override')
224
+ it "accepts a forge module without a version" do
225
+ path = File.join(PROJECT_ROOT, 'spec', 'fixtures', 'unit', 'puppetfile', 'valid-forge-without-version')
216
226
  pf_path = File.join(path, 'Puppetfile')
217
227
  subject = described_class.new(path)
218
- default_branch_override = 'default_branch_override_name'
219
- expect { subject.load!(default_branch_override) }.not_to raise_error
220
- git_module = subject.modules[0]
221
- expect(git_module.default_ref).to eq default_branch_override
228
+ expect { subject.load! }.not_to raise_error
222
229
  end
223
230
  end
224
231
 
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: 2.6.9
4
+ version: 3.0.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: 2020-10-12 00:00:00.000000000 Z
11
+ date: 2018-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.6.1
33
+ version: '2.8'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.6.1
40
+ version: '2.8'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: log4r
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 2.3.0
75
+ version: 2.2.8
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 2.3.0
82
+ version: 2.2.8
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: gettext-setup
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -94,40 +94,6 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.24'
97
- - !ruby/object:Gem::Dependency
98
- name: fast_gettext
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 1.1.0
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 1.1.0
111
- - !ruby/object:Gem::Dependency
112
- name: gettext
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: 3.0.2
118
- - - "<"
119
- - !ruby/object:Gem::Version
120
- version: 3.3.0
121
- type: :runtime
122
- prerelease: false
123
- version_requirements: !ruby/object:Gem::Requirement
124
- requirements:
125
- - - ">="
126
- - !ruby/object:Gem::Version
127
- version: 3.0.2
128
- - - "<"
129
- - !ruby/object:Gem::Version
130
- version: 3.3.0
131
97
  - !ruby/object:Gem::Dependency
132
98
  name: rspec
133
99
  requirement: !ruby/object:Gem::Requirement
@@ -176,14 +142,14 @@ dependencies:
176
142
  requirements:
177
143
  - - "~>"
178
144
  - !ruby/object:Gem::Version
179
- version: 0.9.0
145
+ version: 0.6.1
180
146
  type: :development
181
147
  prerelease: false
182
148
  version_requirements: !ruby/object:Gem::Requirement
183
149
  requirements:
184
150
  - - "~>"
185
151
  - !ruby/object:Gem::Version
186
- version: 0.9.0
152
+ version: 0.6.1
187
153
  description: |2
188
154
  R10K provides a general purpose toolset for deploying Puppet environments and modules.
189
155
  It implements the Puppetfile format and provides a native implementation of Puppet
@@ -194,15 +160,13 @@ executables:
194
160
  extensions: []
195
161
  extra_rdoc_files: []
196
162
  files:
197
- - ".github/pull_request_template.md"
198
- - ".github/workflows/release.yml"
199
163
  - ".gitignore"
200
164
  - ".travis.yml"
201
165
  - CHANGELOG.mkd
202
- - CODEOWNERS
203
166
  - CONTRIBUTING.mkd
204
167
  - Gemfile
205
168
  - LICENSE
169
+ - MAINTAINERS
206
170
  - README.mkd
207
171
  - Rakefile
208
172
  - bin/r10k
@@ -221,6 +185,11 @@ files:
221
185
  - doc/git/providers.mkd
222
186
  - doc/puppetfile.mkd
223
187
  - doc/updating-your-puppetfile.mkd
188
+ - docker/Gemfile
189
+ - docker/ci/build
190
+ - docker/distelli-manifest.yml
191
+ - docker/r10k/Dockerfile
192
+ - docker/r10k/spec/dockerfile_spec.rb
224
193
  - integration/Gemfile
225
194
  - integration/README.mkd
226
195
  - integration/Rakefile
@@ -242,11 +211,22 @@ files:
242
211
  - integration/pre-suite/00_pe_install.rb
243
212
  - integration/pre-suite/10_git_config.rb
244
213
  - integration/pre-suite/20_pe_r10k.rb
214
+ - integration/pre-suite/30_test_utils.rb
245
215
  - integration/pre-suite/README.mkd
216
+ - integration/scripts/README.mkd
217
+ - integration/scripts/setup_r10k_env_centos5.sh
218
+ - integration/scripts/setup_r10k_env_centos6.sh
219
+ - integration/scripts/setup_r10k_env_rhel7.sh
220
+ - integration/scripts/setup_r10k_env_sles11.sh
221
+ - integration/scripts/setup_r10k_env_sles12.sh
222
+ - integration/scripts/setup_r10k_env_ubuntu1004.sh
223
+ - integration/scripts/setup_r10k_env_ubuntu1204.sh
224
+ - integration/scripts/setup_r10k_env_ubuntu1404.sh
246
225
  - integration/tests/Puppetfile/HTTP_PROXY_affects_forge_source.rb
247
226
  - integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb
248
227
  - integration/tests/README.mkd
249
228
  - integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb
229
+ - integration/tests/basic_functionality/negative/attempt_to_install_peonly_module_without_license.rb
250
230
  - integration/tests/basic_functionality/negative/neg_deploy_with_invalid_r10k_yaml.rb
251
231
  - integration/tests/basic_functionality/negative/neg_deploy_with_missing_r10k_yaml.rb
252
232
  - integration/tests/basic_functionality/negative/neg_invalid_git_provider.rb
@@ -269,8 +249,11 @@ files:
269
249
  - integration/tests/git_source/negative/neg_git_unauthorized_https.rb
270
250
  - integration/tests/git_source/negative/neg_git_unauthorized_ssh.rb
271
251
  - integration/tests/git_source/negative/neg_git_unicode_branch.rb
252
+ - integration/tests/i18n/deploy_module_with_unicode_in_file_name.rb
272
253
  - integration/tests/purging/content_not_purged_at_root.rb
273
254
  - integration/tests/purging/default_purging.rb
255
+ - integration/tests/purging/does_not_purge_files_on_white_list.rb
256
+ - integration/tests/purging/invalid_whitelist_types.rb
274
257
  - integration/tests/user_scenario/basic_workflow/multi_env_1000_branches.rb
275
258
  - integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb
276
259
  - integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb
@@ -417,9 +400,10 @@ files:
417
400
  - spec/fixtures/module/forge/eight_hundred/Modulefile
418
401
  - spec/fixtures/module/forge/eight_hundred/metadata.json
419
402
  - spec/fixtures/unit/puppetfile/argument-error/Puppetfile
420
- - spec/fixtures/unit/puppetfile/default-branch-override/Puppetfile
403
+ - spec/fixtures/unit/puppetfile/duplicate-module-error/Puppetfile
421
404
  - spec/fixtures/unit/puppetfile/invalid-syntax/Puppetfile
422
405
  - spec/fixtures/unit/puppetfile/load-error/Puppetfile
406
+ - spec/fixtures/unit/puppetfile/name-error/Puppetfile
423
407
  - spec/fixtures/unit/puppetfile/valid-forge-with-version/Puppetfile
424
408
  - spec/fixtures/unit/puppetfile/valid-forge-without-version/Puppetfile
425
409
  - spec/fixtures/unit/util/purgeable/managed_one/expected_1
@@ -531,14 +515,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
531
515
  requirements:
532
516
  - - ">="
533
517
  - !ruby/object:Gem::Version
534
- version: 1.9.3
518
+ version: 2.0.0
535
519
  required_rubygems_version: !ruby/object:Gem::Requirement
536
520
  requirements:
537
521
  - - ">="
538
522
  - !ruby/object:Gem::Version
539
523
  version: '0'
540
524
  requirements: []
541
- rubygems_version: 3.0.8
525
+ rubyforge_project:
526
+ rubygems_version: 2.6.11
542
527
  signing_key:
543
528
  specification_version: 4
544
529
  summary: Puppet environment and module deployment
@@ -1,4 +0,0 @@
1
- Please add all notable changes to the "Unreleased" section of the CHANGELOG in the format:
2
- ```
3
- - (JIRA ticket) Summary of changes. [Issue or PR #](link to issue or PR)
4
- ```
@@ -1,36 +0,0 @@
1
- name: Tag and release
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- paths:
8
- - 'lib/r10k/version.rb'
9
-
10
- jobs:
11
- release:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v2
15
- with:
16
- fetch-depth: '0'
17
- - name: Bump version and push tag
18
- uses: anothrNick/github-tag-action@1.17.2
19
- env:
20
- GITHUB_TOKEN: ${{ secrets.PUPPET_RELEASE_GH_TOKEN }}
21
- DEFAULT_BUMP: patch
22
- WITH_V: false
23
- # Uncomment this if the tag and version file become out-of-sync and
24
- # you need to tag at a specific version.
25
- # CUSTOM_TAG:
26
- - name: Build gem
27
- uses: scarhand/actions-ruby@master
28
- with:
29
- args: build *.gemspec
30
- - name: Publish gem
31
- uses: scarhand/actions-ruby@master
32
- env:
33
- RUBYGEMS_AUTH_TOKEN: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
34
- with:
35
- args: push *.gem
36
-
data/CODEOWNERS DELETED
@@ -1 +0,0 @@
1
- * @puppetlabs/puppetserver-maintainers @adrienthebo @dhollinger
@@ -1,5 +0,0 @@
1
- mod 'cd4pe',
2
- :git => 'test@randomurl.com:something/some_module.git',
3
- :ref => 'expected_ref',
4
- :default_branch => 'here_lies_the_default_branch'
5
-