r10k 3.15.4 → 3.16.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +17 -0
  3. data/.github/workflows/docker.yml +4 -4
  4. data/.github/workflows/release.yml +3 -2
  5. data/.github/workflows/rspec_tests.yml +7 -7
  6. data/.github/workflows/stale.yml +1 -1
  7. data/CHANGELOG.mkd +23 -0
  8. data/Gemfile +2 -2
  9. data/integration/Rakefile +1 -1
  10. data/integration/files/pre-suite/git_config.pp.erb +1 -1
  11. data/integration/pre-suite/10_git_config.rb +0 -3
  12. data/integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb +5 -4
  13. data/integration/tests/basic_functionality/proxy_specified_in_configuration.rb +1 -1
  14. data/integration/tests/basic_functionality/proxy_with_puppetfile.rb +1 -1
  15. data/integration/tests/basic_functionality/rugged_git_provider_with_ssh.rb +2 -2
  16. data/integration/tests/basic_functionality/rugged_git_provider_without_ssh.rb +2 -2
  17. data/integration/tests/command_line/deploy_env_without_mod_update.rb +0 -3
  18. data/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb +0 -3
  19. data/integration/tests/git_source/HTTP_proxy_and_git_source.rb +5 -10
  20. data/integration/tests/git_source/git_source_git.rb +1 -4
  21. data/integration/tests/git_source/git_source_repeated_remote.rb +0 -3
  22. data/integration/tests/git_source/negative/neg_git_unauthorized_ssh.rb +1 -1
  23. data/integration/tests/purging/content_not_purged_at_root.rb +0 -3
  24. data/integration/tests/purging/default_purging.rb +0 -3
  25. data/integration/tests/purging/does_not_purge_files_on_white_list.rb +0 -3
  26. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +0 -3
  27. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +0 -3
  28. data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +0 -3
  29. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb +0 -3
  30. data/integration/tests/user_scenario/basic_workflow/negative/neg_disk_full.rb +1 -1
  31. data/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +0 -3
  32. data/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb +3 -2
  33. data/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb +1 -5
  34. data/integration/tests/user_scenario/basic_workflow/single_env_10000_files.rb +1 -1
  35. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +0 -3
  36. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb +0 -3
  37. data/integration/tests/user_scenario/basic_workflow/single_env_large_files.rb +1 -1
  38. data/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb +0 -3
  39. data/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb +0 -3
  40. data/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb +0 -3
  41. data/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb +0 -3
  42. data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +0 -3
  43. data/lib/r10k/content_synchronizer.rb +7 -2
  44. data/lib/r10k/git/rugged/bare_repository.rb +4 -3
  45. data/lib/r10k/git/rugged/working_repository.rb +6 -4
  46. data/lib/r10k/module/git.rb +5 -0
  47. data/lib/r10k/module_loader/puppetfile.rb +4 -1
  48. data/lib/r10k/puppetfile.rb +1 -1
  49. data/lib/r10k/version.rb +1 -1
  50. data/locales/r10k.pot +10 -6
  51. data/r10k.gemspec +1 -1
  52. metadata +12 -23
  53. data/docker/.gitignore +0 -1
  54. data/docker/.rspec +0 -4
  55. data/docker/Gemfile +0 -11
  56. data/docker/Makefile +0 -99
  57. data/docker/README.md +0 -28
  58. data/docker/docker-compose.yml +0 -18
  59. data/docker/r10k/Dockerfile +0 -68
  60. data/docker/r10k/adduser.sh +0 -13
  61. data/docker/r10k/docker-entrypoint.d/10-analytics.sh +0 -30
  62. data/docker/r10k/docker-entrypoint.sh +0 -10
  63. data/docker/r10k/release.Dockerfile +0 -55
  64. data/docker/spec/dockerfile_spec.rb +0 -37
  65. data/docker/spec/fixtures/Puppetfile +0 -2
  66. data/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb +0 -83
  67. data/integration/tests/basic_functionality/proxy_with_pe_only_module.rb +0 -128
  68. data/integration/tests/purging/invalid_whitelist_types.rb +0 -63
  69. data/integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb +0 -49
  70. data/integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb +0 -68
@@ -79,8 +79,13 @@ module R10K
79
79
  begin
80
80
  while mods = mods_queue.pop(true) do
81
81
  mods.each do |mod|
82
- updated = mod.sync
83
- updated_modules << mod.name if updated
82
+ begin
83
+ updated = mod.sync
84
+ updated_modules << mod.name if updated
85
+ rescue Exception => e
86
+ logger.error _("Module %{mod_name} failed to synchronize due to %{message}") % {mod_name: mod.name, message: e.message}
87
+ raise e
88
+ end
84
89
  end
85
90
  end
86
91
  rescue ThreadError => e
@@ -56,11 +56,12 @@ class R10K::Git::Rugged::BareRepository < R10K::Git::Rugged::BaseRepository
56
56
  logger.warn { _("Rugged versions prior to 0.24.0 do not support pruning stale branches during fetch, please upgrade your \'rugged\' gem. (Current version is: %{version})") % {version: Rugged::Version} }
57
57
  end
58
58
 
59
- options = {:credentials => credentials, :prune => true}
60
- refspecs = ['+refs/*:refs/*']
61
-
62
59
  remote = remotes[remote_name]
63
60
  proxy = R10K::Git.get_proxy_for_remote(remote)
61
+
62
+ options = {:credentials => credentials, :prune => true, :proxy_url => proxy}
63
+ refspecs = ['+refs/*:refs/*']
64
+
64
65
  results = nil
65
66
 
66
67
  R10K::Git.with_proxy(proxy) do
@@ -27,6 +27,7 @@ class R10K::Git::Rugged::WorkingRepository < R10K::Git::Rugged::BaseRepository
27
27
  def clone(remote, opts = {})
28
28
  logger.debug1 { _("Cloning '%{remote}' into %{path}") % {remote: remote, path: @path } }
29
29
 
30
+ proxy = R10K::Git.get_proxy_for_remote(remote)
30
31
  # libgit2/rugged doesn't support cloning a repository and providing an
31
32
  # alternate object database, making the handling of :alternates a noop.
32
33
  # Unfortunately this means that this method can't really use alternates
@@ -34,10 +35,9 @@ class R10K::Git::Rugged::WorkingRepository < R10K::Git::Rugged::BaseRepository
34
35
  # repository. However alternate databases can be handled when an existing
35
36
  # repository is loaded, so loading a cloned repo will correctly use
36
37
  # alternate object database.
37
- options = {:credentials => credentials}
38
+ options = {:credentials => credentials, :proxy_url => proxy}
38
39
  options.merge!(:alternates => [File.join(opts[:reference], 'objects')]) if opts[:reference]
39
40
 
40
- proxy = R10K::Git.get_proxy_for_remote(remote)
41
41
 
42
42
  R10K::Git.with_proxy(proxy) do
43
43
  @_rugged_repo = ::Rugged::Repository.clone_at(remote, @path.to_s, options)
@@ -85,11 +85,13 @@ class R10K::Git::Rugged::WorkingRepository < R10K::Git::Rugged::BaseRepository
85
85
 
86
86
  def fetch(remote_name = 'origin')
87
87
  logger.debug1 { _("Fetching remote '%{remote}' at %{path}") % {remote: remote_name, path: @path} }
88
- options = {:credentials => credentials}
89
- refspecs = ["+refs/heads/*:refs/remotes/#{remote_name}/*"]
90
88
 
91
89
  remote = remotes[remote_name]
92
90
  proxy = R10K::Git.get_proxy_for_remote(remote)
91
+
92
+ options = {:credentials => credentials, :proxy_url => proxy}
93
+ refspecs = ["+refs/heads/*:refs/remotes/#{remote_name}/*"]
94
+
93
95
  results = nil
94
96
 
95
97
  R10K::Git.with_proxy(proxy) do
@@ -46,6 +46,11 @@ class R10K::Module::Git < R10K::Module::Base
46
46
  # @return [String]
47
47
  attr_reader :default_override_ref
48
48
 
49
+ # @!attribute[r] remote
50
+ # @api private
51
+ # @return [String]
52
+ attr_reader :remote
53
+
49
54
  include R10K::Util::Setopts
50
55
 
51
56
  def initialize(title, dirname, opts, environment=nil)
@@ -104,8 +104,11 @@ module R10K
104
104
  @existing_module_versions_by_name = @existing_module_metadata.map {|mod| [ mod.name, mod.version ] }.to_h
105
105
  empty_load_output.merge(modules: @existing_module_metadata)
106
106
 
107
- rescue SyntaxError, LoadError, ArgumentError, NameError => e
107
+ rescue ScriptError, StandardError => e
108
108
  logger.warn _("Unable to preload Puppetfile because of %{msg}" % { msg: e.message })
109
+
110
+ @existing_module_metadata = []
111
+ @existing_module_versions_by_name = {}
109
112
  end
110
113
 
111
114
  def add_module_metadata(name, info)
@@ -72,7 +72,7 @@ class Puppetfile
72
72
  @overrides = options.delete(:overrides) || {}
73
73
  @default_branch_override = @overrides.dig(:environments, :default_branch_override)
74
74
 
75
- @forge = 'forgeapi.puppetlabs.com'
75
+ @forge = 'forgeapi.puppet.com'
76
76
 
77
77
  @loader = ::R10K::ModuleLoader::Puppetfile.new(
78
78
  basedir: @basedir,
data/lib/r10k/version.rb CHANGED
@@ -2,5 +2,5 @@ module R10K
2
2
  # When updating to a new major (X) or minor (Y) version, include `#major` or
3
3
  # `#minor` (respectively) in your commit message to trigger the appropriate
4
4
  # release. Otherwise, a new patch (Z) version will be released.
5
- VERSION = '3.15.4'
5
+ VERSION = '3.16.2'
6
6
  end
data/locales/r10k.pot CHANGED
@@ -1,16 +1,16 @@
1
1
  # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2022 Puppet, Inc.
2
+ # Copyright (C) 2023 Puppet, Inc.
3
3
  # This file is distributed under the same license as the r10k package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
5
5
  #
6
6
  #, fuzzy
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: r10k 3.9.3-265-gcb0a3463\n"
9
+ "Project-Id-Version: r10k 3.9.3-289-g2f5deb72\n"
10
10
  "\n"
11
11
  "Report-Msgid-Bugs-To: docs@puppetlabs.com\n"
12
- "POT-Creation-Date: 2022-12-08 22:58+0000\n"
13
- "PO-Revision-Date: 2022-12-08 22:58+0000\n"
12
+ "POT-Creation-Date: 2023-06-27 17:39+0000\n"
13
+ "PO-Revision-Date: 2023-06-27 17:39+0000\n"
14
14
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15
15
  "Language-Team: LANGUAGE <LL@li.org>\n"
16
16
  "Language: \n"
@@ -95,7 +95,11 @@ msgstr ""
95
95
  msgid "Error during concurrent deploy of a module: %{message}"
96
96
  msgstr ""
97
97
 
98
- #: ../lib/r10k/content_synchronizer.rb:87
98
+ #: ../lib/r10k/content_synchronizer.rb:86
99
+ msgid "Module %{mod_name} failed to synchronize due to %{message}"
100
+ msgstr ""
101
+
102
+ #: ../lib/r10k/content_synchronizer.rb:92
99
103
  msgid "Module thread %{id} exiting: %{message}"
100
104
  msgstr ""
101
105
 
data/r10k.gemspec CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.add_dependency 'fast_gettext', ['>= 1.1.0', '< 3.0.0']
35
35
  s.add_dependency 'gettext', ['>= 3.0.2', '< 4.0.0']
36
36
 
37
- s.add_dependency 'jwt', '~> 2.2.3'
37
+ s.add_dependency 'jwt', '>= 2.2.3', '< 2.8.0'
38
38
  s.add_dependency 'minitar', '~> 0.9'
39
39
 
40
40
  s.add_development_dependency 'rspec', '~> 3.1'
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.15.4
4
+ version: 3.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Thebo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-19 00:00:00.000000000 Z
11
+ date: 2024-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored2
@@ -150,16 +150,22 @@ dependencies:
150
150
  name: jwt
151
151
  requirement: !ruby/object:Gem::Requirement
152
152
  requirements:
153
- - - "~>"
153
+ - - ">="
154
154
  - !ruby/object:Gem::Version
155
155
  version: 2.2.3
156
+ - - "<"
157
+ - !ruby/object:Gem::Version
158
+ version: 2.8.0
156
159
  type: :runtime
157
160
  prerelease: false
158
161
  version_requirements: !ruby/object:Gem::Requirement
159
162
  requirements:
160
- - - "~>"
163
+ - - ">="
161
164
  - !ruby/object:Gem::Version
162
165
  version: 2.2.3
166
+ - - "<"
167
+ - !ruby/object:Gem::Version
168
+ version: 2.8.0
163
169
  - !ruby/object:Gem::Dependency
164
170
  name: minitar
165
171
  requirement: !ruby/object:Gem::Requirement
@@ -227,6 +233,7 @@ extensions: []
227
233
  extra_rdoc_files: []
228
234
  files:
229
235
  - ".gitattributes"
236
+ - ".github/dependabot.yml"
230
237
  - ".github/pull_request_template.md"
231
238
  - ".github/workflows/docker.yml"
232
239
  - ".github/workflows/release.yml"
@@ -256,19 +263,6 @@ files:
256
263
  - doc/git/providers.mkd
257
264
  - doc/puppetfile.mkd
258
265
  - doc/updating-your-puppetfile.mkd
259
- - docker/.gitignore
260
- - docker/.rspec
261
- - docker/Gemfile
262
- - docker/Makefile
263
- - docker/README.md
264
- - docker/docker-compose.yml
265
- - docker/r10k/Dockerfile
266
- - docker/r10k/adduser.sh
267
- - docker/r10k/docker-entrypoint.d/10-analytics.sh
268
- - docker/r10k/docker-entrypoint.sh
269
- - docker/r10k/release.Dockerfile
270
- - docker/spec/dockerfile_spec.rb
271
- - docker/spec/fixtures/Puppetfile
272
266
  - integration/Gemfile
273
267
  - integration/README.mkd
274
268
  - integration/Rakefile
@@ -295,13 +289,11 @@ files:
295
289
  - integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb
296
290
  - integration/tests/README.mkd
297
291
  - integration/tests/basic_functionality/basic_deployment.rb
298
- - integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb
299
292
  - integration/tests/basic_functionality/negative/neg_deploy_with_invalid_r10k_yaml.rb
300
293
  - integration/tests/basic_functionality/negative/neg_deploy_with_missing_r10k_yaml.rb
301
294
  - integration/tests/basic_functionality/negative/neg_invalid_git_provider.rb
302
295
  - integration/tests/basic_functionality/negative/negative_bad_proxy.rb
303
296
  - integration/tests/basic_functionality/proxy_specified_in_configuration.rb
304
- - integration/tests/basic_functionality/proxy_with_pe_only_module.rb
305
297
  - integration/tests/basic_functionality/proxy_with_puppetfile.rb
306
298
  - integration/tests/basic_functionality/rugged_git_provider_with_ssh.rb
307
299
  - integration/tests/basic_functionality/rugged_git_provider_without_ssh.rb
@@ -321,7 +313,6 @@ files:
321
313
  - integration/tests/purging/content_not_purged_at_root.rb
322
314
  - integration/tests/purging/default_purging.rb
323
315
  - integration/tests/purging/does_not_purge_files_on_white_list.rb
324
- - integration/tests/purging/invalid_whitelist_types.rb
325
316
  - integration/tests/user_scenario/basic_workflow/multi_env_1000_branches.rb
326
317
  - integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb
327
318
  - integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb
@@ -339,7 +330,6 @@ files:
339
330
  - integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb
340
331
  - integration/tests/user_scenario/basic_workflow/negative/neg_invalid_env_name.rb
341
332
  - integration/tests/user_scenario/basic_workflow/negative/neg_invalid_puppet_file.rb
342
- - integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb
343
333
  - integration/tests/user_scenario/basic_workflow/negative/neg_read_only.rb
344
334
  - integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb
345
335
  - integration/tests/user_scenario/basic_workflow/single_env_10000_files.rb
@@ -348,7 +338,6 @@ files:
348
338
  - integration/tests/user_scenario/basic_workflow/single_env_custom_module.rb
349
339
  - integration/tests/user_scenario/basic_workflow/single_env_large_files.rb
350
340
  - integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb
351
- - integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb
352
341
  - integration/tests/user_scenario/basic_workflow/single_env_non-existent_base_dir.rb
353
342
  - integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb
354
343
  - integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb
@@ -498,7 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
498
487
  - !ruby/object:Gem::Version
499
488
  version: '0'
500
489
  requirements: []
501
- rubygems_version: 3.0.3
490
+ rubygems_version: 3.4.20
502
491
  signing_key:
503
492
  specification_version: 4
504
493
  summary: Puppet environment and module deployment
data/docker/.gitignore DELETED
@@ -1 +0,0 @@
1
- TEST-rspec.xml
data/docker/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --require pupperware/spec_helper
2
- --format RspecJunitFormatter
3
- --out TEST-rspec.xml
4
- --format documentation
data/docker/Gemfile DELETED
@@ -1,11 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem 'pupperware',
4
- :git => 'https://github.com/puppetlabs/pupperware.git',
5
- :branch => 'main',
6
- :glob => 'gem/*.gemspec'
7
-
8
- group :test do
9
- gem 'rspec'
10
- gem 'rspec_junit_formatter'
11
- end
data/docker/Makefile DELETED
@@ -1,99 +0,0 @@
1
- PUPPERWARE_ANALYTICS_STREAM ?= dev
2
- NAMESPACE ?= puppet
3
- git_describe = $(shell git describe --tags)
4
- vcs_ref := $(shell git rev-parse HEAD)
5
- build_date := $(shell date -u +%FT%T)
6
- hadolint_available := $(shell hadolint --help > /dev/null 2>&1; echo $$?)
7
- hadolint_command := hadolint
8
- hadolint_container := ghcr.io/hadolint/hadolint:latest
9
- alpine_version := 3.14
10
- # --load (--output=type=docker) can only be used with a single arch / platform
11
- # https://github.com/docker/buildx/issues/59
12
- output_type := docker
13
- platform := linux/amd64
14
- export BUNDLE_PATH = $(PWD)/.bundle/gems
15
- export BUNDLE_BIN = $(PWD)/.bundle/bin
16
- export GEMFILE = $(PWD)/Gemfile
17
- export DOCKER_BUILDKIT ?= 1
18
-
19
- ifeq ($(IS_RELEASE),true)
20
- VERSION ?= $(shell echo $(git_describe) | sed 's/-.*//')
21
- PUBLISHED_VERSION ?= $(shell curl --silent 'https://rubygems.org/api/v1/gems/r10k.json' | jq '."version"' | tr -d '"')
22
- CONTAINER_EXISTS = $(shell DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect $(NAMESPACE)/r10k:$(VERSION) > /dev/null 2>&1; echo $$?)
23
- ifeq ($(CONTAINER_EXISTS),0)
24
- SKIP_BUILD ?= true
25
- else ifneq ($(VERSION),$(PUBLISHED_VERSION))
26
- SKIP_BUILD ?= true
27
- endif
28
-
29
- LATEST_VERSION ?= latest
30
- dockerfile := release.Dockerfile
31
- dockerfile_context := r10k
32
- else
33
- VERSION ?= edge
34
- IS_LATEST := false
35
- dockerfile := Dockerfile
36
- dockerfile_context := $(PWD)/..
37
- endif
38
-
39
- ifeq ($(IS_LATEST),true)
40
- latest_tag := --tag $(NAMESPACE)/r10k:$(LATEST_VERSION)
41
- endif
42
-
43
- prep:
44
- @git fetch --unshallow 2> /dev/null ||:
45
- @git fetch origin 'refs/tags/*:refs/tags/*'
46
- ifeq ($(SKIP_BUILD),true)
47
- @echo "SKIP_BUILD is true, exiting with 1"
48
- @exit 1
49
- endif
50
-
51
- lint:
52
- ifeq ($(hadolint_available),0)
53
- @$(hadolint_command) r10k/$(dockerfile)
54
- else
55
- @docker pull $(hadolint_container)
56
- @docker run --rm -v $(PWD)/r10k/$(dockerfile):/Dockerfile -i $(hadolint_container) $(hadolint_command) Dockerfile
57
- endif
58
-
59
- build: prep
60
- docker pull alpine:$(alpine_version)
61
- docker buildx build \
62
- ${DOCKER_BUILD_FLAGS} \
63
- --output=type=$(output_type) \
64
- --platform $(platform) \
65
- --build-arg alpine_version=$(alpine_version) \
66
- --build-arg vcs_ref=$(vcs_ref) \
67
- --build-arg build_date=$(build_date) \
68
- --build-arg version=$(VERSION) \
69
- --build-arg pupperware_analytics_stream=$(PUPPERWARE_ANALYTICS_STREAM) \
70
- --file r10k/$(dockerfile) \
71
- --tag $(NAMESPACE)/r10k:$(VERSION) $(latest_tag) $(dockerfile_context)
72
-
73
- test: prep
74
- @bundle install --path $$BUNDLE_PATH --gemfile $$GEMFILE --with test
75
- @bundle update
76
- @PUPPET_TEST_DOCKER_IMAGE=$(NAMESPACE)/r10k:$(VERSION) \
77
- bundle exec --gemfile $$GEMFILE \
78
- rspec spec
79
-
80
- # call build to produce multiple architectures
81
- # uses cached output from amd64 build target if it exists
82
- # registry output is equivalent to --push
83
- push-image: platform=linux/amd64,linux/arm64
84
- push-image: output_type=registry
85
- push-image: prep build
86
-
87
- push-readme:
88
- @docker pull sheogorath/readme-to-dockerhub
89
- @docker run --rm \
90
- -v $(PWD)/README.md:/data/README.md \
91
- -e DOCKERHUB_USERNAME="$(DOCKERHUB_USERNAME)" \
92
- -e DOCKERHUB_PASSWORD="$(DOCKERHUB_PASSWORD)" \
93
- -e DOCKERHUB_REPO_PREFIX=puppet \
94
- -e DOCKERHUB_REPO_NAME=r10k \
95
- sheogorath/readme-to-dockerhub
96
-
97
- publish: push-image push-readme
98
-
99
- .PHONY: lint build test prep publish push-image push-readme
data/docker/README.md DELETED
@@ -1,28 +0,0 @@
1
- # [puppetlabs/r10k](https://github.com/puppetlabs/r10k)
2
-
3
- r10k on a Docker image. Based on Alpine 3.8.
4
-
5
- ## Configuration
6
-
7
- The following environment variables are supported:
8
-
9
- - `PUPPERWARE_ANALYTICS_ENABLED`
10
-
11
- Set to 'true' to enable Google Analytics metrics. Defaults to 'false'.
12
-
13
- ## Analytics Data Collection
14
-
15
- The r10k container collects usage data. This is disabled by default. You can enable it by passing `--env PUPPERWARE_ANALYTICS_ENABLED=true`
16
- to your `docker run` command.
17
-
18
- ### What data is collected?
19
- * Version of the r10k container.
20
- * Anonymized IP address is used by Google Analytics for Geolocation data, but the IP address is not collected.
21
-
22
- ### Why does the r10k container collect data?
23
-
24
- We collect data to help us understand how the containers are used and make decisions about upcoming changes.
25
-
26
- ### How can I opt out of r10k container data collection?
27
-
28
- This is disabled by default.
@@ -1,18 +0,0 @@
1
- version: '3.7'
2
-
3
- services:
4
- r10k_check:
5
- image: ${R10K_IMAGE:-puppet/r10k}
6
- environment:
7
- - PUPPERWARE_ANALYTICS_ENABLED=${PUPPERWARE_ANALYTICS_ENABLED:-false}
8
- command: 'puppetfile check --verbose --trace --puppetfile test/Puppetfile'
9
- volumes:
10
- - ${SPEC_DIRECTORY}/fixtures:/home/puppet/test
11
-
12
- r10k_install:
13
- image: ${R10K_IMAGE:-puppet/r10k}
14
- environment:
15
- - PUPPERWARE_ANALYTICS_ENABLED=${PUPPERWARE_ANALYTICS_ENABLED:-false}
16
- command: 'puppetfile install --verbose --trace --puppetfile test/Puppetfile'
17
- volumes:
18
- - ${SPEC_DIRECTORY}/fixtures:/home/puppet/test
@@ -1,68 +0,0 @@
1
- ARG alpine_version=3.14
2
- FROM alpine:${alpine_version} as build
3
-
4
- # hadolint ignore=DL3018
5
- RUN apk add --no-cache ruby git && \
6
- mkdir /workspace
7
- WORKDIR /workspace
8
- COPY . /workspace
9
- RUN gem build r10k.gemspec && \
10
- mv r10k*.gem r10k.gem
11
-
12
- FROM alpine:${alpine_version}
13
-
14
- ARG vcs_ref
15
- ARG build_date
16
- ARG version="3.1.0"
17
- # Used by entrypoint to submit metrics to Google Analytics.
18
- # Published images should use "production" for this build_arg.
19
- ARG pupperware_analytics_stream="dev"
20
- # required to schedule runs of "r10k" in K8s
21
- ARG supercronic_version="0.1.9"
22
- ARG supercronic_sha1sum="5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85"
23
- ARG supercronic="supercronic-linux-amd64"
24
- ARG supercronic_url="https://github.com/aptible/supercronic/releases/download/v$supercronic_version/$supercronic"
25
-
26
- LABEL org.label-schema.maintainer="Puppet Release Team <release@puppet.com>" \
27
- org.label-schema.vendor="Puppet" \
28
- org.label-schema.url="https://github.com/puppetlabs/r10k" \
29
- org.label-schema.name="r10k" \
30
- org.label-schema.license="Apache-2.0" \
31
- org.label-schema.vcs-url="https://github.com/puppetlabs/r10k" \
32
- org.label-schema.schema-version="1.0" \
33
- org.label-schema.dockerfile="/Dockerfile"
34
-
35
- COPY docker/r10k/adduser.sh docker/r10k/docker-entrypoint.sh /
36
- COPY docker/r10k/docker-entrypoint.d /docker-entrypoint.d
37
-
38
- ENTRYPOINT ["/docker-entrypoint.sh"]
39
- CMD ["help"]
40
-
41
- # dynamic LABELs and ENV vars placed lower for the sake of Docker layer caching
42
- ENV PUPPERWARE_ANALYTICS_STREAM="$pupperware_analytics_stream"
43
-
44
- LABEL org.label-schema.version="$version" \
45
- org.label-schema.vcs-ref="$vcs_ref" \
46
- org.label-schema.build-date="$build_date"
47
-
48
- COPY --from=build /workspace/r10k.gem /
49
- SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
50
- # ignore apk and gem pinning
51
- # hadolint ignore=DL3018,DL3028
52
- RUN chmod a+x /adduser.sh /docker-entrypoint.sh /docker-entrypoint.d/*.sh && \
53
- # Add a puppet user to run r10k as for consistency with puppetserver
54
- /adduser.sh && \
55
- chown -R puppet: /docker-entrypoint.d /docker-entrypoint.sh && \
56
- apk add --no-cache ruby openssh-client git ruby-rugged curl ruby-json ruby-etc && \
57
- gem install --no-doc /r10k.gem && \
58
- rm -f /r10k.gem && \
59
- curl --fail --silent --show-error --location --remote-name "$supercronic_url" && \
60
- echo "${supercronic_sha1sum} ${supercronic}" | sha1sum -c - && \
61
- chmod +x "$supercronic" && \
62
- mv "$supercronic" "/usr/local/bin/${supercronic}" && \
63
- ln -s "/usr/local/bin/${supercronic}" /usr/local/bin/supercronic
64
-
65
- USER puppet
66
- WORKDIR /home/puppet
67
-
68
- COPY docker/r10k/Dockerfile /
@@ -1,13 +0,0 @@
1
- #!/bin/sh
2
-
3
- getent_string="$(getent group | grep -e ':999$')"
4
- exit_code=$?
5
-
6
- if [ "$exit_code" = '0' ]; then
7
- group="$(echo $getent_string | cut -d ':' -f1)"
8
- else
9
- addgroup -g 999 puppet
10
- group='puppet'
11
- fi
12
-
13
- adduser -G $group -D -u 999 puppet
@@ -1,30 +0,0 @@
1
- #!/bin/sh
2
-
3
- if [ "${PUPPERWARE_ANALYTICS_ENABLED}" != "true" ]; then
4
- # Don't print out any messages here since this is a CLI container
5
- exit 0
6
- fi
7
-
8
- # See: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
9
- # Tracking ID
10
- tid=UA-132486246-5
11
- # Application Name
12
- an=r10k
13
- # Application Version
14
- av=$(r10k version | cut -d ' ' -f 2)
15
- # Anonymous Client ID
16
- _file=/var/tmp/pwclientid
17
- cid=$(cat $_file 2>/dev/null || (cat /proc/sys/kernel/random/uuid | tee $_file))
18
- # Event Category
19
- ec=${PUPPERWARE_ANALYTICS_STREAM:-dev}
20
- # Event Action
21
- ea=start
22
- # Anonymize ip
23
- aip=1
24
-
25
- _params="v=1&t=event&tid=${tid}&an=${an}&av=${av}&cid=${cid}&ec=${ec}&ea=${ea}&aip=${aip}"
26
- _url="http://www.google-analytics.com/collect?${_params}"
27
-
28
- # Don't print out any messages here since this is a CLI container
29
- curl --fail --silent --show-error --output /dev/null \
30
- -X POST -H "Content-Length: 0" $_url
@@ -1,10 +0,0 @@
1
- #! /bin/sh
2
-
3
- set -e
4
-
5
- for f in /docker-entrypoint.d/*.sh; do
6
- # Don't print out any messages here since this is a CLI container
7
- "$f"
8
- done
9
-
10
- exec /usr/bin/r10k "$@"
@@ -1,55 +0,0 @@
1
- ARG alpine_version=3.14
2
- FROM alpine:${alpine_version}
3
-
4
- ARG vcs_ref
5
- ARG build_date
6
- ARG version="3.1.0"
7
- # Used by entrypoint to submit metrics to Google Analytics.
8
- # Published images should use "production" for this build_arg.
9
- ARG pupperware_analytics_stream="dev"
10
- # required to schedule runs of "r10k" in K8s
11
- ARG supercronic_version="0.1.9"
12
- ARG supercronic_sha1sum="5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85"
13
- ARG supercronic="supercronic-linux-amd64"
14
- ARG supercronic_url="https://github.com/aptible/supercronic/releases/download/v$supercronic_version/$supercronic"
15
-
16
- LABEL org.label-schema.maintainer="Puppet Release Team <release@puppet.com>" \
17
- org.label-schema.vendor="Puppet" \
18
- org.label-schema.url="https://github.com/puppetlabs/r10k" \
19
- org.label-schema.name="r10k" \
20
- org.label-schema.license="Apache-2.0" \
21
- org.label-schema.vcs-url="https://github.com/puppetlabs/r10k" \
22
- org.label-schema.schema-version="1.0" \
23
- org.label-schema.dockerfile="/release.Dockerfile"
24
-
25
- COPY adduser.sh docker-entrypoint.sh /
26
- COPY docker-entrypoint.d /docker-entrypoint.d
27
-
28
- ENTRYPOINT ["/docker-entrypoint.sh"]
29
- CMD ["help"]
30
-
31
- # dyanmic LABELs and ENV vars placed lower for the sake of Docker layer caching
32
- ENV PUPPERWARE_ANALYTICS_STREAM="$pupperware_analytics_stream"
33
-
34
- LABEL org.label-schema.version="$version" \
35
- org.label-schema.vcs-ref="$vcs_ref" \
36
- org.label-schema.build-date="$build_date"
37
-
38
- SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
39
- # ignore apk and gem pinning
40
- # hadolint ignore=DL3018,DL3028
41
- RUN chmod a+x /adduser.sh /docker-entrypoint.sh /docker-entrypoint.d/*.sh && \
42
- /adduser.sh && \
43
- chown -R puppet: /docker-entrypoint.d /docker-entrypoint.sh && \
44
- apk add --no-cache ruby openssh-client git ruby-rugged curl ruby-dev make gcc musl-dev && \
45
- gem install --no-doc r10k:"$version" json etc && \
46
- curl --fail --silent --show-error --location --remote-name "$supercronic_url" && \
47
- echo "${supercronic_sha1sum} ${supercronic}" | sha1sum -c - && \
48
- chmod +x "$supercronic" && \
49
- mv "$supercronic" "/usr/local/bin/${supercronic}" && \
50
- ln -s "/usr/local/bin/${supercronic}" /usr/local/bin/supercronic
51
-
52
- USER puppet
53
- WORKDIR /home/puppet
54
-
55
- COPY release.Dockerfile /
@@ -1,37 +0,0 @@
1
- require 'rspec/core'
2
- require 'fileutils'
3
- require 'open3'
4
- include Pupperware::SpecHelpers
5
-
6
- ENV['SPEC_DIRECTORY'] = File.dirname(__FILE__)
7
- # unifies volume naming
8
- ENV['COMPOSE_PROJECT_NAME'] ||= 'r10k'
9
-
10
- RSpec.configure do |c|
11
- c.before(:suite) do
12
- ENV['R10K_IMAGE'] = require_test_image
13
- pull_images(['r10k_check','r10k_install'])
14
- teardown_cluster()
15
- # no certs to preload, but if the suite adds puppetserver, be explicit
16
- docker_compose_up(preload_certs: true)
17
- end
18
-
19
- c.after(:suite) do
20
- teardown_cluster()
21
- FileUtils.rm_rf(File.join(ENV['SPEC_DIRECTORY'], 'fixtures', 'modules'))
22
- end
23
- end
24
-
25
- describe 'r10k container' do
26
- {
27
- 'r10k_check': 'validate',
28
- 'r10k_install': 'install',
29
- }.each do |container, op|
30
- it "should #{op} the Puppetfile" do
31
- container = get_service_container(container)
32
- wait_on_container_exit(container)
33
- expect(get_container_exit_code(container)).to eq(0)
34
- emit_log(container)
35
- end
36
- end
37
- end