r10k 3.3.3 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ class R10K::Source::Yaml < R10K::Source::Hash
2
+ R10K::Source.register(:yaml, self)
3
+
4
+ def initialize(name, basedir, options = {})
5
+ config = options[:config] || '/etc/puppetlabs/r10k/environments.yaml'
6
+
7
+ begin
8
+ contents = ::YAML.load_file(config)
9
+ rescue => e
10
+ raise ConfigError, _("Couldn't open environments file %{file}: %{err}") % {file: config, err: e.message}
11
+ end
12
+
13
+ # Set the environments key for the parent class to consume
14
+ options[:environments] = contents
15
+
16
+ # All we need to do is supply options with the :environments hash.
17
+ # The R10K::Source::Hash parent class takes care of the rest.
18
+ super(name, basedir, options)
19
+ end
20
+ end
@@ -0,0 +1,32 @@
1
+ class R10K::Source::Yamldir < R10K::Source::Hash
2
+ R10K::Source.register(:yamldir, self)
3
+
4
+ def initialize(name, basedir, options = {})
5
+ config = options[:config] || '/etc/puppetlabs/r10k/environments.d'
6
+
7
+ unless File.directory?(config)
8
+ raise R10K::Deployment::Config::ConfigError, _("Error opening %{dir}: config must be a directory") % {dir: config}
9
+ end
10
+
11
+ unless File.readable?(config)
12
+ raise R10K::Deployment::Config::ConfigError, _("Error opening %{dir}: permission denied") % {dir: config}
13
+ end
14
+
15
+ environment_data = Dir.glob(File.join(config, '*.yaml')).reduce({}) do |memo,path|
16
+ name = File.basename(path, '.yaml')
17
+ begin
18
+ contents = ::YAML.load_file(path)
19
+ rescue => e
20
+ raise R10K::Deployment::Config::ConfigError, _("Error loading %{path}: %{err}") % {path: path, err: e.message}
21
+ end
22
+ memo.merge({name => contents })
23
+ end
24
+
25
+ # Set the environments key for the parent class to consume
26
+ options[:environments] = environment_data
27
+
28
+ # All we need to do is supply options with the :environments hash.
29
+ # The R10K::Source::Hash parent class takes care of the rest.
30
+ super(name, basedir, options)
31
+ end
32
+ end
@@ -1,7 +1,7 @@
1
1
  require 'r10k/logging'
2
2
  require 'r10k/errors/formatting'
3
3
  require 'r10k/util/setopts'
4
- require 'colored'
4
+ require 'colored2'
5
5
 
6
6
  module R10K
7
7
  module Util
@@ -1,3 +1,3 @@
1
1
  module R10K
2
- VERSION = '3.3.3'
2
+ VERSION = '3.4.0'
3
3
  end
@@ -6,11 +6,11 @@
6
6
  #, fuzzy
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: r10k 3.3.0-7-g6a2159a\n"
9
+ "Project-Id-Version: r10k 3.3.3-22-g3035320\n"
10
10
  "\n"
11
11
  "Report-Msgid-Bugs-To: docs@puppetlabs.com\n"
12
- "POT-Creation-Date: 2019-06-14 22:40+0000\n"
13
- "PO-Revision-Date: 2019-06-14 22:40+0000\n"
12
+ "POT-Creation-Date: 2019-12-17 14:55+0000\n"
13
+ "PO-Revision-Date: 2019-12-17 14:55+0000\n"
14
14
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15
15
  "Language-Team: LANGUAGE <LL@li.org>\n"
16
16
  "Language: \n"
@@ -52,7 +52,7 @@ msgid "Environment %{env_dir} is new, updating all modules"
52
52
  msgstr ""
53
53
 
54
54
  #: ../lib/r10k/action/deploy/environment.rb:143
55
- msgid "Deploying Puppetfile content %{mod_path}"
55
+ msgid "Deploying %{origin} content %{path}"
56
56
  msgstr ""
57
57
 
58
58
  #: ../lib/r10k/action/deploy/module.rb:49
@@ -107,6 +107,14 @@ msgstr ""
107
107
  msgid "%{class} has not implemented method %{method}"
108
108
  msgstr ""
109
109
 
110
+ #: ../lib/r10k/environment/with_modules.rb:104
111
+ msgid "Puppetfile cannot contain module names defined by environment %{name}"
112
+ msgstr ""
113
+
114
+ #: ../lib/r10k/environment/with_modules.rb:106
115
+ msgid "Remove the conflicting definitions of the following modules: %{conflicts}"
116
+ msgstr ""
117
+
110
118
  #: ../lib/r10k/feature.rb:27
111
119
  msgid "Testing to see if feature %{name} is available."
112
120
  msgstr ""
@@ -131,19 +139,19 @@ msgstr ""
131
139
  msgid "Proc %{block} for feature %{name} returned %{output}"
132
140
  msgstr ""
133
141
 
134
- #: ../lib/r10k/forge/module_release.rb:164
142
+ #: ../lib/r10k/forge/module_release.rb:196
135
143
  msgid "Unpacking %{tarball_cache_path} to %{target_dir} (with tmpdir %{tmp_path})"
136
144
  msgstr ""
137
145
 
138
- #: ../lib/r10k/forge/module_release.rb:166
146
+ #: ../lib/r10k/forge/module_release.rb:198
139
147
  msgid "Valid files unpacked: %{valid_files}"
140
148
  msgstr ""
141
149
 
142
- #: ../lib/r10k/forge/module_release.rb:168
150
+ #: ../lib/r10k/forge/module_release.rb:200
143
151
  msgid "These files existed in the module's tar file, but are invalid filetypes and were not unpacked: %{invalid_files}"
144
152
  msgstr ""
145
153
 
146
- #: ../lib/r10k/forge/module_release.rb:171
154
+ #: ../lib/r10k/forge/module_release.rb:203
147
155
  msgid "Symlinks are unsupported and were not unpacked from the module tarball. %{release_slug} contained these ignored symlinks: %{symlinks}"
148
156
  msgstr ""
149
157
 
@@ -295,19 +303,19 @@ msgstr ""
295
303
  msgid "Module %{name} with args %{args} doesn't have an implementation. (Are you using the right arguments?)"
296
304
  msgstr ""
297
305
 
298
- #: ../lib/r10k/module/base.rb:105
306
+ #: ../lib/r10k/module/base.rb:110
299
307
  msgid "Module name (%{title}) must match either 'modulename' or 'owner/modulename'"
300
308
  msgstr ""
301
309
 
302
- #: ../lib/r10k/module/forge.rb:70 ../lib/r10k/module/forge.rb:95
310
+ #: ../lib/r10k/module/forge.rb:70 ../lib/r10k/module/forge.rb:99
303
311
  msgid "The module %{title} does not exist on %{url}."
304
312
  msgstr ""
305
313
 
306
- #: ../lib/r10k/module/forge.rb:170
314
+ #: ../lib/r10k/module/forge.rb:174
307
315
  msgid "Forge module names must match 'owner/modulename'"
308
316
  msgstr ""
309
317
 
310
- #: ../lib/r10k/module/git.rb:92
318
+ #: ../lib/r10k/module/git.rb:97
311
319
  msgid "Unhandled options %{unhandled} specified for %{class}"
312
320
  msgstr ""
313
321
 
@@ -323,35 +331,35 @@ msgstr ""
323
331
  msgid "Using Puppetfile '%{puppetfile}'"
324
332
  msgstr ""
325
333
 
326
- #: ../lib/r10k/puppetfile.rb:70
334
+ #: ../lib/r10k/puppetfile.rb:71
327
335
  msgid "Puppetfile %{path} missing or unreadable"
328
336
  msgstr ""
329
337
 
330
- #: ../lib/r10k/puppetfile.rb:80
338
+ #: ../lib/r10k/puppetfile.rb:84
331
339
  msgid "Failed to evaluate %{path}"
332
340
  msgstr ""
333
341
 
334
- #: ../lib/r10k/puppetfile.rb:90
342
+ #: ../lib/r10k/puppetfile.rb:98
335
343
  msgid "Puppetfiles cannot contain duplicate module names."
336
344
  msgstr ""
337
345
 
338
- #: ../lib/r10k/puppetfile.rb:92
346
+ #: ../lib/r10k/puppetfile.rb:100
339
347
  msgid "Remove the duplicates of the following modules: %{dupes}"
340
348
  msgstr ""
341
349
 
342
- #: ../lib/r10k/puppetfile.rb:179
350
+ #: ../lib/r10k/puppetfile.rb:192
343
351
  msgid "Updating modules with %{pool_size} threads"
344
352
  msgstr ""
345
353
 
346
- #: ../lib/r10k/puppetfile.rb:190
354
+ #: ../lib/r10k/puppetfile.rb:203
347
355
  msgid "Error during concurrent deploy of a module: %{message}"
348
356
  msgstr ""
349
357
 
350
- #: ../lib/r10k/puppetfile.rb:212
358
+ #: ../lib/r10k/puppetfile.rb:225
351
359
  msgid "Module thread %{id} exiting: %{message}"
352
360
  msgstr ""
353
361
 
354
- #: ../lib/r10k/puppetfile.rb:269
362
+ #: ../lib/r10k/puppetfile.rb:282
355
363
  msgid "unrecognized declaration '%{method}'"
356
364
  msgstr ""
357
365
 
@@ -435,6 +443,22 @@ msgstr ""
435
443
  msgid "Branch %{branch} filtered out by ignore_branch_prefixes %{ibp}"
436
444
  msgstr ""
437
445
 
446
+ #: ../lib/r10k/source/yaml.rb:10
447
+ msgid "Couldn't open environments file %{file}: %{err}"
448
+ msgstr ""
449
+
450
+ #: ../lib/r10k/source/yamldir.rb:8
451
+ msgid "Error opening %{dir}: config must be a directory"
452
+ msgstr ""
453
+
454
+ #: ../lib/r10k/source/yamldir.rb:12
455
+ msgid "Error opening %{dir}: permission denied"
456
+ msgstr ""
457
+
458
+ #: ../lib/r10k/source/yamldir.rb:20
459
+ msgid "Error loading %{path}: %{err}"
460
+ msgstr ""
461
+
438
462
  #: ../lib/r10k/svn/working_dir.rb:43
439
463
  msgid "Both username and password must be specified"
440
464
  msgstr ""
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
 
23
23
  s.license = 'Apache-2.0'
24
24
 
25
- s.add_dependency 'colored', '1.2'
25
+ s.add_dependency 'colored2', '3.1.2'
26
26
  s.add_dependency 'cri', '2.15.6'
27
27
 
28
28
  s.add_dependency 'log4r', '1.1.10'
@@ -369,6 +369,7 @@ describe R10K::Action::Deploy::Environment do
369
369
  allow(mock_forge_module_1).to receive(:repo).and_raise(NoMethodError)
370
370
 
371
371
  fake_env = Fake_Environment.new(@tmp_path, {:name => "my_cool_environment", :signature => "pablo picasso"})
372
+ allow(fake_env).to receive(:modules).and_return(mock_puppetfile.modules)
372
373
  subject.send(:write_environment_info!, fake_env, "2019-01-01 23:23:22 +0000", true)
373
374
 
374
375
  file_contents = File.read("#{@tmp_path}/.r10k-deploy.json")
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r10k
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.3
4
+ version: 3.4.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: 2019-10-21 00:00:00.000000000 Z
11
+ date: 2020-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: colored
14
+ name: colored2
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '1.2'
19
+ version: 3.1.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '1.2'
26
+ version: 3.1.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cri
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -161,6 +161,7 @@ extensions: []
161
161
  extra_rdoc_files: []
162
162
  files:
163
163
  - ".gitattributes"
164
+ - ".github/workflows/docker.yml"
164
165
  - ".gitignore"
165
166
  - ".travis.yml"
166
167
  - CHANGELOG.mkd
@@ -168,7 +169,6 @@ files:
168
169
  - CONTRIBUTING.mkd
169
170
  - Gemfile
170
171
  - LICENSE
171
- - MAINTAINERS
172
172
  - README.mkd
173
173
  - Rakefile
174
174
  - azure-pipelines.yml
@@ -193,10 +193,11 @@ files:
193
193
  - docker/Gemfile
194
194
  - docker/Makefile
195
195
  - docker/README.md
196
- - docker/distelli-manifest.yml
197
196
  - docker/r10k/Dockerfile
197
+ - docker/r10k/adduser.sh
198
198
  - docker/r10k/docker-entrypoint.d/10-analytics.sh
199
199
  - docker/r10k/docker-entrypoint.sh
200
+ - docker/r10k/release.Dockerfile
200
201
  - docker/spec/dockerfile_spec.rb
201
202
  - docker/spec/fixtures/Puppetfile
202
203
  - integration/Gemfile
@@ -319,10 +320,12 @@ files:
319
320
  - lib/r10k/deployment.rb
320
321
  - lib/r10k/deployment/config.rb
321
322
  - lib/r10k/environment.rb
323
+ - lib/r10k/environment/bare.rb
322
324
  - lib/r10k/environment/base.rb
323
325
  - lib/r10k/environment/git.rb
324
326
  - lib/r10k/environment/name.rb
325
327
  - lib/r10k/environment/svn.rb
328
+ - lib/r10k/environment/with_modules.rb
326
329
  - lib/r10k/errors.rb
327
330
  - lib/r10k/errors/formatting.rb
328
331
  - lib/r10k/feature.rb
@@ -373,7 +376,10 @@ files:
373
376
  - lib/r10k/source.rb
374
377
  - lib/r10k/source/base.rb
375
378
  - lib/r10k/source/git.rb
379
+ - lib/r10k/source/hash.rb
376
380
  - lib/r10k/source/svn.rb
381
+ - lib/r10k/source/yaml.rb
382
+ - lib/r10k/source/yamldir.rb
377
383
  - lib/r10k/svn.rb
378
384
  - lib/r10k/svn/remote.rb
379
385
  - lib/r10k/svn/working_dir.rb
@@ -532,8 +538,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
532
538
  - !ruby/object:Gem::Version
533
539
  version: '0'
534
540
  requirements: []
535
- rubyforge_project:
536
- rubygems_version: 2.5.1
541
+ rubygems_version: 3.0.6
537
542
  signing_key:
538
543
  specification_version: 4
539
544
  summary: Puppet environment and module deployment
@@ -1,18 +0,0 @@
1
- {
2
- "version": 1,
3
- "file_format": "This MAINTAINERS file format is described at https://github.com/puppetlabs/maintainers",
4
- "issues": "https://tickets.puppet.com/browse/RK",
5
- "internal_list": "https://groups.google.com/a/puppet.com/forum/?hl=en#!forum/discuss-code-manager-maintainers",
6
- "people": [
7
- {
8
- "github": "andersonmills",
9
- "email": "anderson@puppet.com",
10
- "name": "Anderson Mills"
11
- },
12
- {
13
- "github": "scotje",
14
- "email": "jesse@puppet.com",
15
- "name": "Jesse Scott"
16
- }
17
- ]
18
- }
@@ -1,9 +0,0 @@
1
- pe-and-platform/r10k:
2
- PreBuild:
3
- - make lint
4
- Build:
5
- - make build PUPPERWARE_ANALYTICS_STREAM=production
6
- - make test
7
- AfterBuildSuccess:
8
- - docker login -u "$DISTELLI_DOCKER_USERNAME" -p "$DISTELLI_DOCKER_PW" "$DISTELLI_DOCKER_ENDPOINT"
9
- - make publish