r10k 3.14.1 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +17 -0
  3. data/.github/workflows/docker.yml +9 -4
  4. data/.github/workflows/release.yml +3 -2
  5. data/.github/workflows/rspec_tests.yml +8 -10
  6. data/CHANGELOG.mkd +100 -0
  7. data/CODEOWNERS +1 -2
  8. data/Gemfile +2 -2
  9. data/README.mkd +18 -19
  10. data/doc/common-patterns.mkd +1 -2
  11. data/doc/dynamic-environments/configuration.mkd +91 -12
  12. data/doc/dynamic-environments/usage.mkd +4 -0
  13. data/doc/dynamic-environments/workflow-guide.mkd +3 -3
  14. data/doc/faq.mkd +1 -1
  15. data/doc/puppetfile.mkd +9 -3
  16. data/integration/Gemfile +3 -4
  17. data/integration/Rakefile +58 -23
  18. data/integration/files/pre-suite/git_config.pp.erb +1 -1
  19. data/integration/pre-suite/00_pe_install.rb +3 -0
  20. data/integration/pre-suite/10_git_config.rb +1 -3
  21. data/integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb +5 -4
  22. data/integration/tests/basic_functionality/negative/negative_bad_proxy.rb +1 -1
  23. data/integration/tests/basic_functionality/proxy_specified_in_configuration.rb +2 -2
  24. data/integration/tests/basic_functionality/proxy_with_puppetfile.rb +2 -2
  25. data/integration/tests/basic_functionality/rugged_git_provider_with_ssh.rb +3 -3
  26. data/integration/tests/basic_functionality/rugged_git_provider_without_ssh.rb +3 -3
  27. data/integration/tests/command_line/deploy_env_without_mod_update.rb +0 -3
  28. data/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb +0 -3
  29. data/integration/tests/git_source/HTTP_proxy_and_git_source.rb +5 -10
  30. data/integration/tests/git_source/git_source_git.rb +1 -4
  31. data/integration/tests/git_source/git_source_repeated_remote.rb +2 -5
  32. data/integration/tests/git_source/git_source_submodule.rb +1 -1
  33. data/integration/tests/git_source/negative/neg_git_unauthorized_ssh.rb +1 -1
  34. data/integration/tests/purging/content_not_purged_at_root.rb +2 -5
  35. data/integration/tests/purging/default_purging.rb +0 -3
  36. data/integration/tests/purging/{does_not_purge_files_on_white_list.rb → does_not_purge_files_on_allowlist.rb} +2 -5
  37. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +1 -4
  38. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +1 -4
  39. data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +1 -4
  40. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb +0 -3
  41. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module.rb +1 -1
  42. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module_ref.rb +1 -1
  43. data/integration/tests/user_scenario/basic_workflow/negative/neg_disk_full.rb +1 -1
  44. data/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +0 -3
  45. data/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb +3 -2
  46. data/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb +1 -5
  47. data/integration/tests/user_scenario/basic_workflow/single_env_10000_files.rb +1 -1
  48. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +1 -4
  49. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb +0 -3
  50. data/integration/tests/user_scenario/basic_workflow/single_env_large_files.rb +1 -1
  51. data/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb +0 -3
  52. data/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb +0 -3
  53. data/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb +1 -4
  54. data/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb +0 -3
  55. data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +0 -3
  56. data/lib/r10k/action/deploy/environment.rb +2 -19
  57. data/lib/r10k/action/deploy/module.rb +1 -0
  58. data/lib/r10k/action/puppetfile/check.rb +7 -0
  59. data/lib/r10k/action/puppetfile/install.rb +3 -1
  60. data/lib/r10k/cli/deploy.rb +15 -1
  61. data/lib/r10k/cli/puppetfile.rb +1 -0
  62. data/lib/r10k/content_synchronizer.rb +7 -2
  63. data/lib/r10k/environment/with_modules.rb +24 -1
  64. data/lib/r10k/environment.rb +0 -1
  65. data/lib/r10k/git/rugged/bare_repository.rb +5 -4
  66. data/lib/r10k/git/rugged/thin_repository.rb +7 -0
  67. data/lib/r10k/git/rugged/working_repository.rb +13 -7
  68. data/lib/r10k/git/shellgit/thin_repository.rb +5 -1
  69. data/lib/r10k/git/shellgit/working_repository.rb +5 -4
  70. data/lib/r10k/git/stateful_repository.rb +4 -4
  71. data/lib/r10k/module/base.rb +3 -3
  72. data/lib/r10k/module/git.rb +19 -5
  73. data/lib/r10k/module_loader/puppetfile/dsl.rb +4 -0
  74. data/lib/r10k/module_loader/puppetfile.rb +22 -14
  75. data/lib/r10k/puppetfile.rb +1 -1
  76. data/lib/r10k/settings/container.rb +1 -0
  77. data/lib/r10k/settings.rb +6 -7
  78. data/lib/r10k/tarball.rb +1 -1
  79. data/lib/r10k/version.rb +1 -1
  80. data/locales/r10k.pot +34 -82
  81. data/r10k.gemspec +8 -18
  82. metadata +40 -213
  83. data/.github/workflows/stale.yml +0 -21
  84. data/.travis.yml +0 -42
  85. data/docker/.gitignore +0 -1
  86. data/docker/.rspec +0 -4
  87. data/docker/Gemfile +0 -11
  88. data/docker/Makefile +0 -92
  89. data/docker/README.md +0 -28
  90. data/docker/docker-compose.yml +0 -18
  91. data/docker/r10k/Dockerfile +0 -68
  92. data/docker/r10k/adduser.sh +0 -13
  93. data/docker/r10k/docker-entrypoint.d/10-analytics.sh +0 -30
  94. data/docker/r10k/docker-entrypoint.sh +0 -10
  95. data/docker/r10k/release.Dockerfile +0 -55
  96. data/docker/spec/dockerfile_spec.rb +0 -37
  97. data/docker/spec/fixtures/Puppetfile +0 -2
  98. data/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb +0 -83
  99. data/integration/tests/basic_functionality/proxy_with_pe_only_module.rb +0 -128
  100. data/integration/tests/purging/invalid_whitelist_types.rb +0 -63
  101. data/integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb +0 -49
  102. data/integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb +0 -68
  103. data/lib/r10k/environment/bare.rb +0 -13
  104. data/spec/fixtures/empty/.empty +0 -0
  105. data/spec/fixtures/integration/git/puppet-boolean-bare.tar +0 -0
  106. data/spec/fixtures/module/forge/bad_module/metadata.json +0 -1
  107. data/spec/fixtures/module/forge/eight_hundred/Modulefile +0 -8
  108. data/spec/fixtures/module/forge/eight_hundred/metadata.json +0 -19
  109. data/spec/fixtures/tarball/tarball.tar.gz +0 -0
  110. data/spec/fixtures/unit/action/r10k.yaml +0 -5
  111. data/spec/fixtures/unit/action/r10k_cachedir.yaml +0 -2
  112. data/spec/fixtures/unit/action/r10k_creds.yaml +0 -9
  113. data/spec/fixtures/unit/action/r10k_forge_auth.yaml +0 -4
  114. data/spec/fixtures/unit/action/r10k_forge_auth_no_url.yaml +0 -3
  115. data/spec/fixtures/unit/action/r10k_generate_types.yaml +0 -3
  116. data/spec/fixtures/unit/action/r10k_logging.yaml +0 -12
  117. data/spec/fixtures/unit/action/r10k_puppet_path.yaml +0 -3
  118. data/spec/fixtures/unit/puppetfile/argument-error/Puppetfile +0 -1
  119. data/spec/fixtures/unit/puppetfile/default-branch-override/Puppetfile +0 -5
  120. data/spec/fixtures/unit/puppetfile/duplicate-module-error/Puppetfile +0 -10
  121. data/spec/fixtures/unit/puppetfile/forge-override/Puppetfile +0 -8
  122. data/spec/fixtures/unit/puppetfile/invalid-syntax/Puppetfile +0 -1
  123. data/spec/fixtures/unit/puppetfile/load-error/Puppetfile +0 -1
  124. data/spec/fixtures/unit/puppetfile/name-error/Puppetfile +0 -1
  125. data/spec/fixtures/unit/puppetfile/valid-forge-with-version/Puppetfile +0 -1
  126. data/spec/fixtures/unit/puppetfile/valid-forge-without-version/Puppetfile +0 -1
  127. data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile +0 -10
  128. data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile.new +0 -10
  129. data/spec/fixtures/unit/util/purgeable/managed_one/expected_1 +0 -0
  130. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/managed_symlink_file +0 -1
  131. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_allowlisted_2/ignored_1 +0 -0
  132. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_expected_1 +0 -0
  133. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_unmanaged_1 +0 -0
  134. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/unmanaged_symlink_dir +0 -1
  135. data/spec/fixtures/unit/util/purgeable/managed_one/managed_symlink_dir +0 -1
  136. data/spec/fixtures/unit/util/purgeable/managed_one/unmanaged_1 +0 -0
  137. data/spec/fixtures/unit/util/purgeable/managed_one/unmanaged_symlink_file +0 -1
  138. data/spec/fixtures/unit/util/purgeable/managed_two/.hidden/unmanaged_3 +0 -0
  139. data/spec/fixtures/unit/util/purgeable/managed_two/expected_2 +0 -0
  140. data/spec/fixtures/unit/util/purgeable/managed_two/unmanaged_2 +0 -0
  141. data/spec/fixtures/unit/util/subprocess/runner/no-execute.sh +0 -3
  142. data/spec/integration/git/rugged/bare_repository_spec.rb +0 -13
  143. data/spec/integration/git/rugged/cache_spec.rb +0 -33
  144. data/spec/integration/git/rugged/thin_repository_spec.rb +0 -14
  145. data/spec/integration/git/rugged/working_repository_spec.rb +0 -48
  146. data/spec/integration/git/shellgit/bare_repository_spec.rb +0 -13
  147. data/spec/integration/git/shellgit/thin_repository_spec.rb +0 -14
  148. data/spec/integration/git/shellgit/working_repository_spec.rb +0 -13
  149. data/spec/integration/git/stateful_repository_spec.rb +0 -159
  150. data/spec/integration/util/purageable_spec.rb +0 -41
  151. data/spec/matchers/exit_with.rb +0 -28
  152. data/spec/matchers/match_realpath.rb +0 -18
  153. data/spec/r10k-mocks/mock_config.rb +0 -33
  154. data/spec/r10k-mocks/mock_env.rb +0 -18
  155. data/spec/r10k-mocks/mock_source.rb +0 -17
  156. data/spec/r10k-mocks.rb +0 -3
  157. data/spec/shared-contexts/git-fixtures.rb +0 -55
  158. data/spec/shared-contexts/tarball.rb +0 -32
  159. data/spec/shared-examples/deploy-actions.rb +0 -69
  160. data/spec/shared-examples/git/bare_repository.rb +0 -132
  161. data/spec/shared-examples/git/thin_repository.rb +0 -26
  162. data/spec/shared-examples/git/working_repository.rb +0 -207
  163. data/spec/shared-examples/git-repository.rb +0 -38
  164. data/spec/shared-examples/puppetfile-action.rb +0 -39
  165. data/spec/shared-examples/settings/ancestry.rb +0 -44
  166. data/spec/shared-examples/subprocess-runner.rb +0 -89
  167. data/spec/spec_helper.rb +0 -41
  168. data/spec/unit/action/cri_runner_spec.rb +0 -72
  169. data/spec/unit/action/deploy/deploy_helpers_spec.rb +0 -38
  170. data/spec/unit/action/deploy/display_spec.rb +0 -61
  171. data/spec/unit/action/deploy/environment_spec.rb +0 -640
  172. data/spec/unit/action/deploy/module_spec.rb +0 -476
  173. data/spec/unit/action/puppetfile/check_spec.rb +0 -53
  174. data/spec/unit/action/puppetfile/cri_runner_spec.rb +0 -47
  175. data/spec/unit/action/puppetfile/install_spec.rb +0 -112
  176. data/spec/unit/action/puppetfile/purge_spec.rb +0 -60
  177. data/spec/unit/action/runner_spec.rb +0 -407
  178. data/spec/unit/action/visitor_spec.rb +0 -39
  179. data/spec/unit/cli_spec.rb +0 -9
  180. data/spec/unit/deployment/config_spec.rb +0 -33
  181. data/spec/unit/deployment_spec.rb +0 -162
  182. data/spec/unit/environment/bare_spec.rb +0 -13
  183. data/spec/unit/environment/base_spec.rb +0 -122
  184. data/spec/unit/environment/git_spec.rb +0 -114
  185. data/spec/unit/environment/name_spec.rb +0 -181
  186. data/spec/unit/environment/plain_spec.rb +0 -8
  187. data/spec/unit/environment/svn_spec.rb +0 -146
  188. data/spec/unit/environment/tarball_spec.rb +0 -45
  189. data/spec/unit/environment/with_modules_spec.rb +0 -75
  190. data/spec/unit/errors/formatting_spec.rb +0 -84
  191. data/spec/unit/feature_spec.rb +0 -50
  192. data/spec/unit/forge/module_release_spec.rb +0 -213
  193. data/spec/unit/git/alternates_spec.rb +0 -116
  194. data/spec/unit/git/cache_spec.rb +0 -66
  195. data/spec/unit/git/rugged/cache_spec.rb +0 -48
  196. data/spec/unit/git/rugged/credentials_spec.rb +0 -215
  197. data/spec/unit/git/shellgit/cache_spec.rb +0 -27
  198. data/spec/unit/git/stateful_repository_spec.rb +0 -45
  199. data/spec/unit/git_spec.rb +0 -102
  200. data/spec/unit/initializers_spec.rb +0 -68
  201. data/spec/unit/instance_cache_spec.rb +0 -78
  202. data/spec/unit/keyed_factory_spec.rb +0 -51
  203. data/spec/unit/logging/terminaloutputter_spec.rb +0 -53
  204. data/spec/unit/logging_spec.rb +0 -68
  205. data/spec/unit/module/base_spec.rb +0 -118
  206. data/spec/unit/module/forge_spec.rb +0 -271
  207. data/spec/unit/module/git_spec.rb +0 -387
  208. data/spec/unit/module/metadata_file_spec.rb +0 -68
  209. data/spec/unit/module/svn_spec.rb +0 -208
  210. data/spec/unit/module/tarball_spec.rb +0 -70
  211. data/spec/unit/module_loader/puppetfile_spec.rb +0 -421
  212. data/spec/unit/module_spec.rb +0 -114
  213. data/spec/unit/puppetfile_spec.rb +0 -304
  214. data/spec/unit/settings/collection_spec.rb +0 -123
  215. data/spec/unit/settings/container_spec.rb +0 -92
  216. data/spec/unit/settings/definition_spec.rb +0 -79
  217. data/spec/unit/settings/enum_definition_spec.rb +0 -20
  218. data/spec/unit/settings/inheritance_spec.rb +0 -38
  219. data/spec/unit/settings/list_spec.rb +0 -88
  220. data/spec/unit/settings/loader_spec.rb +0 -110
  221. data/spec/unit/settings/uri_definition_spec.rb +0 -23
  222. data/spec/unit/settings_spec.rb +0 -303
  223. data/spec/unit/source/base_spec.rb +0 -31
  224. data/spec/unit/source/exec_spec.rb +0 -81
  225. data/spec/unit/source/git_spec.rb +0 -233
  226. data/spec/unit/source/hash_spec.rb +0 -54
  227. data/spec/unit/source/svn_spec.rb +0 -196
  228. data/spec/unit/source/yaml_spec.rb +0 -42
  229. data/spec/unit/source_spec.rb +0 -10
  230. data/spec/unit/svn/remote_spec.rb +0 -21
  231. data/spec/unit/svn/working_dir_spec.rb +0 -56
  232. data/spec/unit/tarball_spec.rb +0 -57
  233. data/spec/unit/util/attempt_spec.rb +0 -82
  234. data/spec/unit/util/cacheable_spec.rb +0 -23
  235. data/spec/unit/util/commands_spec.rb +0 -61
  236. data/spec/unit/util/downloader_spec.rb +0 -98
  237. data/spec/unit/util/exec_env_spec.rb +0 -56
  238. data/spec/unit/util/purgeable_spec.rb +0 -267
  239. data/spec/unit/util/setopts_spec.rb +0 -83
  240. data/spec/unit/util/subprocess/result_spec.rb +0 -36
  241. data/spec/unit/util/subprocess/runner/posix_spec.rb +0 -7
  242. data/spec/unit/util/subprocess/runner/pump_spec.rb +0 -79
  243. data/spec/unit/util/subprocess/runner/windows_spec.rb +0 -7
  244. data/spec/unit/util/subprocess/subprocess_error_spec.rb +0 -26
  245. data/spec/unit/util/subprocess_spec.rb +0 -65
  246. data/spec/unit/util/symbolize_keys_spec.rb +0 -67
@@ -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
@@ -1,2 +0,0 @@
1
- moduledir '/tmp/modules'
2
- mod 'puppetlabs/ntp'
@@ -1,83 +0,0 @@
1
- require 'git_utils'
2
- require 'r10k_utils'
3
- require 'master_manipulator'
4
- test_name 'RK-158 - C92362 - Install a PE-only module from forge'
5
-
6
- #Init
7
- env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
8
- r10k_fqp = get_r10k_fqp(master)
9
- master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
10
-
11
- git_repo_path = '/git_repos'
12
- git_repo_name = 'environments'
13
- git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
14
- git_environments_path = '/root/environments'
15
- last_commit = git_last_commit(master, git_environments_path)
16
- git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
17
-
18
- r10k_config_path = get_r10k_config_file_path(master)
19
- r10k_config_bak_path = "#{r10k_config_path}.bak"
20
-
21
- #In-line files
22
- r10k_conf = <<-CONF
23
- cachedir: '/var/cache/r10k'
24
- git:
25
- provider: '#{git_provider}'
26
- sources:
27
- control:
28
- basedir: "#{env_path}"
29
- remote: "#{git_control_remote}"
30
- CONF
31
-
32
- #Manifest
33
- site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp')
34
- site_pp = create_site_pp(master_certname, ' include peonly')
35
-
36
- # Verification
37
- notify_message_regex = /I am in the production environment, this is a PE only module/
38
-
39
- #Teardown
40
- teardown do
41
- step 'remove license file'
42
- on(master, 'rm -f /etc/puppetlabs/license.key')
43
-
44
- step 'Restore Original "r10k" Config'
45
- on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")
46
-
47
- step 'cleanup r10k'
48
- clean_up_r10k(master, last_commit, git_environments_path)
49
- end
50
-
51
- #Setup
52
- step 'Stub the forge'
53
- stub_forge_on(master)
54
-
55
- step 'Backup a Valid "r10k" Config'
56
- on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
57
-
58
- step 'Update the "r10k" Config'
59
- create_remote_file(master, r10k_config_path, r10k_conf)
60
-
61
- step 'Download license file from artifactory'
62
- curl_on(master, 'https://artifactory.delivery.puppetlabs.net/artifactory/generic/r10k_test_license.key -o /etc/puppetlabs/license.key')
63
-
64
- step 'Inject New "site.pp" to the "production" Environment'
65
- inject_site_pp(master, site_pp_path, site_pp)
66
-
67
- step 'Copy Puppetfile to "production" Environment Git Repo'
68
- create_remote_file(master, "#{git_environments_path}/Puppetfile", 'mod "ztr-peonly"')
69
-
70
- step 'Push Changes'
71
- git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_path)
72
-
73
- #Tests
74
- step 'Deploy "production" Environment via r10k'
75
- on(master, "#{r10k_fqp} deploy environment -p")
76
-
77
- agents.each do |agent|
78
- step "Run Puppet Agent"
79
- on(agent, puppet('agent', '--test', '--environment production'), :acceptable_exit_codes => 2) do |result|
80
- assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
81
- assert_match(notify_message_regex, result.stdout, 'Expected message not found!')
82
- end
83
- end
@@ -1,128 +0,0 @@
1
- require 'git_utils'
2
- require 'r10k_utils'
3
- require 'master_manipulator'
4
- test_name 'RK-242 '#'- C87652 - Specify the proxy in the r10k.yaml'
5
-
6
- confine(:to, :platform => ['el', 'sles'])
7
-
8
- #Init
9
- master_platform = fact_on(master, 'osfamily')
10
- master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
11
- env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
12
- r10k_fqp = get_r10k_fqp(master)
13
-
14
- git_repo_path = '/git_repos'
15
- git_repo_name = 'environments'
16
- git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
17
- git_environments_path = '/root/environments'
18
- last_commit = git_last_commit(master, git_environments_path)
19
- git_provider = ENV['GIT_PROVIDER']
20
-
21
- local_files_root_path = ENV['FILES'] || 'files'
22
-
23
- git_manifest_template_path = File.join(local_files_root_path, 'pre-suite', 'git_config.pp.erb')
24
- git_manifest = ERB.new(File.read(git_manifest_template_path)).result(binding)
25
-
26
- r10k_config_path = get_r10k_config_file_path(master)
27
- r10k_config_bak_path = "#{r10k_config_path}.bak"
28
-
29
- case master_platform
30
- when 'RedHat'
31
- pkg_manager = 'yum'
32
- when 'Suse'
33
- pkg_manager = 'zypper'
34
- end
35
-
36
- install_squid = "#{pkg_manager} install -y squid"
37
- remove_squid = "#{pkg_manager} remove -y squid"
38
- squid_log = "/var/log/squid/access.log"
39
-
40
- #In-line files
41
- r10k_conf = <<-CONF
42
- cachedir: '/var/cache/r10k'
43
- git:
44
- provider: '#{git_provider}'
45
- sources:
46
- control:
47
- basedir: "#{env_path}"
48
- remote: "#{git_control_remote}"
49
- forge:
50
- proxy: "http://#{master.hostname}:3128"
51
- CONF
52
-
53
- #Manifest
54
- site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp')
55
- site_pp = create_site_pp(master_certname, ' include peonly')
56
-
57
- #Verification
58
- squid_log_regex = /CONNECT forgeapi.puppetlabs.com:443/
59
- notify_message_regex = /I am in the production environment, this is a PE only module/
60
-
61
- #Teardown
62
- teardown do
63
- step 'remove license file'
64
- on(master, 'rm -f /etc/puppetlabs/license.key')
65
-
66
- step 'Restore "git" Package'
67
- on(master, puppet('apply'), :stdin => git_manifest, :acceptable_exit_codes => [0,2])
68
-
69
- step 'Restore Original "r10k" Config'
70
- on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")
71
-
72
- clean_up_r10k(master, last_commit, git_environments_path)
73
-
74
- step 'Remove Squid'
75
- on(master, puppet("apply -e 'service {'squid' : ensure => stopped}'"))
76
- on(master, remove_squid)
77
- end
78
-
79
- #Setup
80
- step 'Stub the forge'
81
- stub_forge_on(master)
82
-
83
- step 'Backup Current "r10k" Config'
84
- on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
85
-
86
- step 'Update the "r10k" Config'
87
- create_remote_file(master, r10k_config_path, r10k_conf)
88
-
89
- step 'Download license file from artifactory'
90
- curl_on(master, 'https://artifactory.delivery.puppetlabs.net/artifactory/generic/r10k_test_license.key -o /etc/puppetlabs/license.key')
91
-
92
- step 'Checkout "production" Branch'
93
- git_on(master, 'checkout production', git_environments_path)
94
-
95
- step 'Inject New "site.pp" to the "production" Environment'
96
- inject_site_pp(master, site_pp_path, site_pp)
97
-
98
- step 'Copy Puppetfile to "production" Environment with PE only module'
99
- create_remote_file(master, "#{git_environments_path}/Puppetfile", 'mod "ztr-peonly"')
100
-
101
- step 'Push Changes'
102
- git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_path)
103
-
104
- step 'Install and configure squid proxy'
105
- on(master, install_squid)
106
-
107
- step 'turn off the firewall'
108
- on(master, puppet("apply -e 'service {'iptables' : ensure => stopped}'"))
109
-
110
- step 'start squid proxy'
111
- on(master, puppet("apply -e 'service {'squid' : ensure => running}'"))
112
-
113
- #Tests
114
- step 'Deploy "production" Environment via r10k'
115
- on(master, "#{r10k_fqp} deploy environment -p")
116
-
117
- step 'Read the squid logs'
118
- on(master, "cat #{squid_log}") do |result|
119
- assert_match(squid_log_regex, result.stdout, 'Proxy logs did not indicate use of the proxy.')
120
- end
121
-
122
- agents.each do |agent|
123
- step "Run Puppet Agent"
124
- on(agent, puppet('agent', '--test', '--environment production'), :acceptable_exit_codes => [0,2]) do |result|
125
- assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
126
- assert_match(notify_message_regex, result.stdout, 'Expected message not found!')
127
- end
128
- end
@@ -1,63 +0,0 @@
1
- require 'git_utils'
2
- require 'r10k_utils'
3
- require 'master_manipulator'
4
- test_name 'RK-257 - C98043 - verify default whitelist only accepts strings or array of strings'
5
-
6
- #Init
7
- env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
8
- r10k_fqp = get_r10k_fqp(master)
9
- git_environments_path = '/root/environments'
10
-
11
- git_repo_path = '/git_repos'
12
- git_repo_name = 'environments'
13
- git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
14
-
15
- last_commit = git_last_commit(master, git_environments_path)
16
- git_provider = ENV['GIT_PROVIDER']
17
-
18
- r10k_config_path = get_r10k_config_file_path(master)
19
- r10k_config_bak_path = "#{r10k_config_path}.bak"
20
-
21
- #invalid content to test
22
- hash_whitelist = '{:cats => \'cats.txt\'}'
23
- invalid_array_content_whitelist = '[\'cats.txt\', [:broken]]'
24
-
25
- teardown do
26
- step 'Restore Original "r10k" Config'
27
- on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")
28
-
29
- clean_up_r10k(master, last_commit, git_environments_path)
30
- end
31
-
32
- # initalize file content
33
- step 'Stub the forge'
34
- stub_forge_on(master)
35
-
36
- step 'Backup Current "r10k" Config'
37
- on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
38
-
39
- [hash_whitelist, invalid_array_content_whitelist].each do |whitelist_content|
40
- r10k_conf = <<-CONF
41
- cachedir: '/var/cache/r10k'
42
- git:
43
- provider: '#{git_provider}'
44
- sources:
45
- control:
46
- basedir: "#{env_path}"
47
- remote: "#{git_control_remote}"
48
- deploy:
49
- purge_whitelist: #{whitelist_content}
50
- CONF
51
-
52
- step 'Update the "r10k" Config'
53
- create_remote_file(master, r10k_config_path, r10k_conf)
54
-
55
- step 'Deploy r10k, and verify that invalid whitelist content causes error'
56
- on(master, "#{r10k_fqp} deploy environment -p", :accept_all_exit_codes => true) do |result|
57
- error = /did not find expected node content while parsing a flow node/
58
- error_message = 'whitelist content did not generate expected error'
59
- expect_failure('RK-263') do
60
- assert_no_match(result.stdout, error, error_message)
61
- end
62
- end
63
- end
@@ -1,49 +0,0 @@
1
- require 'git_utils'
2
- require 'r10k_utils'
3
- test_name 'CODEMGMT-127 - C64121 - Attempt to Deploy Environment with Forge Module Specified at Deleted Release'
4
-
5
- #This test uses the spotty module at https://forge-aio01-petest.puppetlabs.com//puppetlabs/spotty, with valid released 0.1.0 and 0.3.0 versions, and deleted 0.2.0 and 0.4.0 versions.
6
-
7
- #Init
8
- git_environments_path = '/root/environments'
9
- last_commit = git_last_commit(master, git_environments_path)
10
- r10k_fqp = get_r10k_fqp(master)
11
-
12
- #Verification
13
- if get_puppet_version(master) < 4.0
14
- error_notification_regex = /No releases matching '0.2.0'/
15
- else
16
- error_notification_regex = /error.* -> The module release puppetlabs-spotty-0.2.0 does not exist on/i
17
- end
18
-
19
- #File
20
- puppet_file = <<-PUPPETFILE
21
- mod "puppetlabs/spotty", '0.2.0'
22
- PUPPETFILE
23
-
24
- puppet_file_path = File.join(git_environments_path, 'Puppetfile')
25
-
26
- #Teardown
27
- teardown do
28
- clean_up_r10k(master, last_commit, git_environments_path)
29
- end
30
-
31
- #Setup
32
- step 'Stub Forge on Master'
33
- stub_forge_on(master)
34
-
35
- #Tests
36
- step 'Checkout "production" Branch'
37
- git_on(master, 'checkout production', git_environments_path)
38
-
39
- step 'Create "Puppetfile" for the "production" Environment'
40
- create_remote_file(master, puppet_file_path, puppet_file)
41
-
42
- step 'Push Changes'
43
- git_add_commit_push(master, 'production', 'Add module.', git_environments_path)
44
-
45
- #Tests
46
- step "Deploy production environment via r10k with module specified at deleted version"
47
- on(master, "#{r10k_fqp} deploy environment -p -v", :acceptable_exit_codes => 1) do |result|
48
- assert_match(error_notification_regex, result.stderr, 'Unexpected error was detected!')
49
- end
@@ -1,68 +0,0 @@
1
- require 'git_utils'
2
- require 'r10k_utils'
3
- test_name 'CODEMGMT-127 - C64120 - Single Environment with Forge Module where Latest Release has been Deleted'
4
-
5
- #This test uses the spotty module at https://forge-aio01-petest.puppetlabs.com//puppetlabs/spotty, which has valid 0.1.0 and 0.3.0 versions, and deleted 0.2.0 and 0.4.0 versions.
6
-
7
- #Init
8
- env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
9
- prod_env_modules_path = File.join(env_path, 'production', 'modules')
10
- r10k_fqp = get_r10k_fqp(master)
11
-
12
- git_environments_path = '/root/environments'
13
- last_commit = git_last_commit(master, git_environments_path)
14
-
15
- #Verification
16
- module_contents = 'Version 3'
17
- module_contents_regex = /\A#{module_contents}\n\z/
18
-
19
- module_contents_path = File.join(prod_env_modules_path, 'spotty', 'manifests', 'init.pp')
20
- module_version_filepath = File.join(prod_env_modules_path, 'spotty', 'metadata.json')
21
- module_version_3_regex = /"0.3.0"/
22
-
23
- #File
24
- puppet_file = <<-PUPPETFILE
25
- mod "puppetlabs/spotty"
26
- PUPPETFILE
27
-
28
- puppet_file_path = File.join(git_environments_path, 'Puppetfile')
29
-
30
- #Teardown
31
- teardown do
32
- clean_up_r10k(master, last_commit, git_environments_path)
33
- end
34
-
35
- #Setup
36
- step 'Stub Forge on Master'
37
- stub_forge_on(master)
38
-
39
- #Tests
40
- step 'Checkout "production" Branch'
41
- git_on(master, 'checkout production', git_environments_path)
42
-
43
- step 'Create "Puppetfile" for the "production" Environment'
44
- create_remote_file(master, puppet_file_path, puppet_file)
45
-
46
- step 'Push Changes'
47
- git_add_commit_push(master, 'production', 'Add module.', git_environments_path)
48
-
49
- #Tests
50
- step 'Deploy "production" Environment via r10k with modules'
51
- on(master, "#{r10k_fqp} deploy environment -p -v")
52
-
53
- agents.each do |agent|
54
- step "Run Puppet Agent"
55
- on(agent, puppet('agent', '--test', '--environment production'), :acceptable_exit_codes => [0,2]) do |result|
56
- assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
57
- end
58
-
59
- step 'Verify Contents'
60
- on(master, "cat #{module_contents_path}") do |result|
61
- assert_match(module_contents, result.stdout, 'File Content is Invalid')
62
- end
63
-
64
- step 'Verify Version'
65
- on(master, "grep version #{module_version_filepath}") do |result|
66
- assert_match(module_version_3_regex, result.stdout, 'File Content is Invalid')
67
- end
68
- end
@@ -1,13 +0,0 @@
1
- class R10K::Environment::Bare < R10K::Environment::Plain
2
-
3
- R10K::Environment.register(:bare, self)
4
-
5
- def initialize(name, basedir, dirname, options = {})
6
- logger.warn _('"bare" environment type is deprecated; please use "plain" instead (environment: %{name})') % {name: name}
7
- super
8
- end
9
-
10
- def signature
11
- 'bare-default'
12
- end
13
- end
File without changes
@@ -1 +0,0 @@
1
- I am bad JSON!
@@ -1,8 +0,0 @@
1
- name 'branan-eight_hundred'
2
- version '8.0.0'
3
- source 'https://github.com/branan/puppet-module-eight_hundred'
4
- author 'Branan Purvine-Riley'
5
- license 'Apache License 2.0'
6
- summary '800 modules! WOOOOOOO!'
7
- description '800 modules! WOOOOOOOOOOOOOOOOOO!'
8
- project_page 'https://github.com/branan/puppet-module-eight_hundred'
@@ -1,19 +0,0 @@
1
- {
2
- "checksums": {
3
- "Modulefile": "1e780d794bcd6629dc3006129fc02edf"
4
- },
5
- "license": "Apache License 2.0",
6
- "types": [
7
-
8
- ],
9
- "version": "8.0.0",
10
- "dependencies": [
11
-
12
- ],
13
- "summary": "800 modules! WOOOOOOO!",
14
- "source": "https://github.com/branan/puppet-module-eight_hundred",
15
- "description": "800 modules! WOOOOOOOOOOOOOOOOOO!",
16
- "author": "Branan Purvine-Riley",
17
- "name": "branan-eight_hundred",
18
- "project_page": "https://github.com/branan/puppet-module-eight_hundred"
19
- }
Binary file