r10k 3.14.1 → 3.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docker.yml +5 -0
  3. data/.github/workflows/rspec_tests.yml +1 -0
  4. data/CHANGELOG.mkd +19 -0
  5. data/CODEOWNERS +2 -2
  6. data/README.mkd +2 -2
  7. data/doc/dynamic-environments/configuration.mkd +78 -11
  8. data/doc/dynamic-environments/usage.mkd +4 -0
  9. data/doc/dynamic-environments/workflow-guide.mkd +3 -3
  10. data/doc/faq.mkd +1 -1
  11. data/docker/Makefile +17 -10
  12. data/integration/tests/git_source/HTTP_proxy_and_git_source.rb +1 -1
  13. data/integration/tests/git_source/git_source_repeated_remote.rb +2 -2
  14. data/integration/tests/purging/content_not_purged_at_root.rb +2 -2
  15. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +1 -1
  16. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +1 -1
  17. data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +1 -1
  18. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module.rb +1 -1
  19. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module_ref.rb +1 -1
  20. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +1 -1
  21. data/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb +1 -1
  22. data/lib/r10k/environment/with_modules.rb +24 -1
  23. data/lib/r10k/git/rugged/thin_repository.rb +7 -0
  24. data/lib/r10k/git/rugged/working_repository.rb +7 -3
  25. data/lib/r10k/git/shellgit/thin_repository.rb +4 -0
  26. data/lib/r10k/git/shellgit/working_repository.rb +3 -2
  27. data/lib/r10k/git/stateful_repository.rb +4 -4
  28. data/lib/r10k/module/git.rb +1 -1
  29. data/lib/r10k/module_loader/puppetfile.rb +8 -5
  30. data/lib/r10k/settings/container.rb +1 -0
  31. data/lib/r10k/version.rb +1 -1
  32. data/r10k.gemspec +5 -7
  33. metadata +16 -154
  34. data/.travis.yml +0 -42
  35. data/spec/fixtures/empty/.empty +0 -0
  36. data/spec/fixtures/integration/git/puppet-boolean-bare.tar +0 -0
  37. data/spec/fixtures/module/forge/bad_module/metadata.json +0 -1
  38. data/spec/fixtures/module/forge/eight_hundred/Modulefile +0 -8
  39. data/spec/fixtures/module/forge/eight_hundred/metadata.json +0 -19
  40. data/spec/fixtures/tarball/tarball.tar.gz +0 -0
  41. data/spec/fixtures/unit/action/r10k.yaml +0 -5
  42. data/spec/fixtures/unit/action/r10k_cachedir.yaml +0 -2
  43. data/spec/fixtures/unit/action/r10k_creds.yaml +0 -9
  44. data/spec/fixtures/unit/action/r10k_forge_auth.yaml +0 -4
  45. data/spec/fixtures/unit/action/r10k_forge_auth_no_url.yaml +0 -3
  46. data/spec/fixtures/unit/action/r10k_generate_types.yaml +0 -3
  47. data/spec/fixtures/unit/action/r10k_logging.yaml +0 -12
  48. data/spec/fixtures/unit/action/r10k_puppet_path.yaml +0 -3
  49. data/spec/fixtures/unit/puppetfile/argument-error/Puppetfile +0 -1
  50. data/spec/fixtures/unit/puppetfile/default-branch-override/Puppetfile +0 -5
  51. data/spec/fixtures/unit/puppetfile/duplicate-module-error/Puppetfile +0 -10
  52. data/spec/fixtures/unit/puppetfile/forge-override/Puppetfile +0 -8
  53. data/spec/fixtures/unit/puppetfile/invalid-syntax/Puppetfile +0 -1
  54. data/spec/fixtures/unit/puppetfile/load-error/Puppetfile +0 -1
  55. data/spec/fixtures/unit/puppetfile/name-error/Puppetfile +0 -1
  56. data/spec/fixtures/unit/puppetfile/valid-forge-with-version/Puppetfile +0 -1
  57. data/spec/fixtures/unit/puppetfile/valid-forge-without-version/Puppetfile +0 -1
  58. data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile +0 -10
  59. data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile.new +0 -10
  60. data/spec/fixtures/unit/util/purgeable/managed_one/expected_1 +0 -0
  61. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/managed_symlink_file +0 -1
  62. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_allowlisted_2/ignored_1 +0 -0
  63. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_expected_1 +0 -0
  64. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_unmanaged_1 +0 -0
  65. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/unmanaged_symlink_dir +0 -1
  66. data/spec/fixtures/unit/util/purgeable/managed_one/managed_symlink_dir +0 -1
  67. data/spec/fixtures/unit/util/purgeable/managed_one/unmanaged_1 +0 -0
  68. data/spec/fixtures/unit/util/purgeable/managed_one/unmanaged_symlink_file +0 -1
  69. data/spec/fixtures/unit/util/purgeable/managed_two/.hidden/unmanaged_3 +0 -0
  70. data/spec/fixtures/unit/util/purgeable/managed_two/expected_2 +0 -0
  71. data/spec/fixtures/unit/util/purgeable/managed_two/unmanaged_2 +0 -0
  72. data/spec/fixtures/unit/util/subprocess/runner/no-execute.sh +0 -3
  73. data/spec/integration/git/rugged/bare_repository_spec.rb +0 -13
  74. data/spec/integration/git/rugged/cache_spec.rb +0 -33
  75. data/spec/integration/git/rugged/thin_repository_spec.rb +0 -14
  76. data/spec/integration/git/rugged/working_repository_spec.rb +0 -48
  77. data/spec/integration/git/shellgit/bare_repository_spec.rb +0 -13
  78. data/spec/integration/git/shellgit/thin_repository_spec.rb +0 -14
  79. data/spec/integration/git/shellgit/working_repository_spec.rb +0 -13
  80. data/spec/integration/git/stateful_repository_spec.rb +0 -159
  81. data/spec/integration/util/purageable_spec.rb +0 -41
  82. data/spec/matchers/exit_with.rb +0 -28
  83. data/spec/matchers/match_realpath.rb +0 -18
  84. data/spec/r10k-mocks/mock_config.rb +0 -33
  85. data/spec/r10k-mocks/mock_env.rb +0 -18
  86. data/spec/r10k-mocks/mock_source.rb +0 -17
  87. data/spec/r10k-mocks.rb +0 -3
  88. data/spec/shared-contexts/git-fixtures.rb +0 -55
  89. data/spec/shared-contexts/tarball.rb +0 -32
  90. data/spec/shared-examples/deploy-actions.rb +0 -69
  91. data/spec/shared-examples/git/bare_repository.rb +0 -132
  92. data/spec/shared-examples/git/thin_repository.rb +0 -26
  93. data/spec/shared-examples/git/working_repository.rb +0 -207
  94. data/spec/shared-examples/git-repository.rb +0 -38
  95. data/spec/shared-examples/puppetfile-action.rb +0 -39
  96. data/spec/shared-examples/settings/ancestry.rb +0 -44
  97. data/spec/shared-examples/subprocess-runner.rb +0 -89
  98. data/spec/spec_helper.rb +0 -41
  99. data/spec/unit/action/cri_runner_spec.rb +0 -72
  100. data/spec/unit/action/deploy/deploy_helpers_spec.rb +0 -38
  101. data/spec/unit/action/deploy/display_spec.rb +0 -61
  102. data/spec/unit/action/deploy/environment_spec.rb +0 -640
  103. data/spec/unit/action/deploy/module_spec.rb +0 -476
  104. data/spec/unit/action/puppetfile/check_spec.rb +0 -53
  105. data/spec/unit/action/puppetfile/cri_runner_spec.rb +0 -47
  106. data/spec/unit/action/puppetfile/install_spec.rb +0 -112
  107. data/spec/unit/action/puppetfile/purge_spec.rb +0 -60
  108. data/spec/unit/action/runner_spec.rb +0 -407
  109. data/spec/unit/action/visitor_spec.rb +0 -39
  110. data/spec/unit/cli_spec.rb +0 -9
  111. data/spec/unit/deployment/config_spec.rb +0 -33
  112. data/spec/unit/deployment_spec.rb +0 -162
  113. data/spec/unit/environment/bare_spec.rb +0 -13
  114. data/spec/unit/environment/base_spec.rb +0 -122
  115. data/spec/unit/environment/git_spec.rb +0 -114
  116. data/spec/unit/environment/name_spec.rb +0 -181
  117. data/spec/unit/environment/plain_spec.rb +0 -8
  118. data/spec/unit/environment/svn_spec.rb +0 -146
  119. data/spec/unit/environment/tarball_spec.rb +0 -45
  120. data/spec/unit/environment/with_modules_spec.rb +0 -75
  121. data/spec/unit/errors/formatting_spec.rb +0 -84
  122. data/spec/unit/feature_spec.rb +0 -50
  123. data/spec/unit/forge/module_release_spec.rb +0 -213
  124. data/spec/unit/git/alternates_spec.rb +0 -116
  125. data/spec/unit/git/cache_spec.rb +0 -66
  126. data/spec/unit/git/rugged/cache_spec.rb +0 -48
  127. data/spec/unit/git/rugged/credentials_spec.rb +0 -215
  128. data/spec/unit/git/shellgit/cache_spec.rb +0 -27
  129. data/spec/unit/git/stateful_repository_spec.rb +0 -45
  130. data/spec/unit/git_spec.rb +0 -102
  131. data/spec/unit/initializers_spec.rb +0 -68
  132. data/spec/unit/instance_cache_spec.rb +0 -78
  133. data/spec/unit/keyed_factory_spec.rb +0 -51
  134. data/spec/unit/logging/terminaloutputter_spec.rb +0 -53
  135. data/spec/unit/logging_spec.rb +0 -68
  136. data/spec/unit/module/base_spec.rb +0 -118
  137. data/spec/unit/module/forge_spec.rb +0 -271
  138. data/spec/unit/module/git_spec.rb +0 -387
  139. data/spec/unit/module/metadata_file_spec.rb +0 -68
  140. data/spec/unit/module/svn_spec.rb +0 -208
  141. data/spec/unit/module/tarball_spec.rb +0 -70
  142. data/spec/unit/module_loader/puppetfile_spec.rb +0 -421
  143. data/spec/unit/module_spec.rb +0 -114
  144. data/spec/unit/puppetfile_spec.rb +0 -304
  145. data/spec/unit/settings/collection_spec.rb +0 -123
  146. data/spec/unit/settings/container_spec.rb +0 -92
  147. data/spec/unit/settings/definition_spec.rb +0 -79
  148. data/spec/unit/settings/enum_definition_spec.rb +0 -20
  149. data/spec/unit/settings/inheritance_spec.rb +0 -38
  150. data/spec/unit/settings/list_spec.rb +0 -88
  151. data/spec/unit/settings/loader_spec.rb +0 -110
  152. data/spec/unit/settings/uri_definition_spec.rb +0 -23
  153. data/spec/unit/settings_spec.rb +0 -303
  154. data/spec/unit/source/base_spec.rb +0 -31
  155. data/spec/unit/source/exec_spec.rb +0 -81
  156. data/spec/unit/source/git_spec.rb +0 -233
  157. data/spec/unit/source/hash_spec.rb +0 -54
  158. data/spec/unit/source/svn_spec.rb +0 -196
  159. data/spec/unit/source/yaml_spec.rb +0 -42
  160. data/spec/unit/source_spec.rb +0 -10
  161. data/spec/unit/svn/remote_spec.rb +0 -21
  162. data/spec/unit/svn/working_dir_spec.rb +0 -56
  163. data/spec/unit/tarball_spec.rb +0 -57
  164. data/spec/unit/util/attempt_spec.rb +0 -82
  165. data/spec/unit/util/cacheable_spec.rb +0 -23
  166. data/spec/unit/util/commands_spec.rb +0 -61
  167. data/spec/unit/util/downloader_spec.rb +0 -98
  168. data/spec/unit/util/exec_env_spec.rb +0 -56
  169. data/spec/unit/util/purgeable_spec.rb +0 -267
  170. data/spec/unit/util/setopts_spec.rb +0 -83
  171. data/spec/unit/util/subprocess/result_spec.rb +0 -36
  172. data/spec/unit/util/subprocess/runner/posix_spec.rb +0 -7
  173. data/spec/unit/util/subprocess/runner/pump_spec.rb +0 -79
  174. data/spec/unit/util/subprocess/runner/windows_spec.rb +0 -7
  175. data/spec/unit/util/subprocess/subprocess_error_spec.rb +0 -26
  176. data/spec/unit/util/subprocess_spec.rb +0 -65
  177. data/spec/unit/util/symbolize_keys_spec.rb +0 -67
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51cffcbc4e3340cf55e51da3a60e66e4c4b851d17bdd566d257213e6a4244bdc
4
- data.tar.gz: 10c04f87924b3c5f4eb84cba797879a0a1ac09a6fbc3e0f598c53788d1d5f9b2
3
+ metadata.gz: bbe3c00c11efc712b5146a3dc869eb9855151bbe1d686fef6c13f9c17efc6283
4
+ data.tar.gz: 8d67474c7fe6266d04fd5ae42a301c4eb9f72f284b7d487350843384f1e37816
5
5
  SHA512:
6
- metadata.gz: 8684fc987a031207807de406810ec0529ef00ab8cad321923451a51d5d869ec2aee3cbca411ca37dbe1bbc7ec3c4a0e7daa58df099b0bc1c74005e5c914e0ba2
7
- data.tar.gz: b8515912cdc5099dfd5c238da01663f7352185bd8454363cdce4bf562138302002fd563fe7783c212071fee2a8855f5abc78dd7d66c1dc006595613b697cd8eb
6
+ metadata.gz: 5eadfe0185cd3bf7dcad760135e566dff7d8652a42c4b70e3968c9dfffd08770a722c07ad89a3c92065c5b57ef91ace5c79d13edf54277932297a67431c818df
7
+ data.tar.gz: 49cdc0476700c4938ac010eae9293fe94945ff81450bc72aaac00b969af96d9f04cc7733a54e79a576d9533011cec8e947d893fb79f824a9bbb6992f57912de0
@@ -27,6 +27,11 @@ jobs:
27
27
  with:
28
28
  ruby-version: 2.6.x
29
29
  - run: gem install bundler
30
+ - uses: actions/checkout@v2
31
+ - name: Set up QEMU
32
+ uses: docker/setup-qemu-action@v1
33
+ - name: Set up Docker Buildx
34
+ uses: docker/setup-buildx-action@v1
30
35
  - name: Build container
31
36
  working-directory: docker
32
37
  run: |
@@ -15,6 +15,7 @@ jobs:
15
15
  - {os: ubuntu-18.04, ruby: 2.5}
16
16
  - {os: ubuntu-18.04, ruby: 2.6}
17
17
  - {os: ubuntu-18.04, ruby: 2.7}
18
+ - {os: ubuntu-18.04, ruby: 3.1}
18
19
  - {os: ubuntu-18.04, ruby: jruby-9.2.10.0}
19
20
  - {os: windows-2019, ruby: 2.5}
20
21
  - {os: windows-2019, ruby: 2.6}
data/CHANGELOG.mkd CHANGED
@@ -4,6 +4,25 @@ CHANGELOG
4
4
  Unreleased
5
5
  ----------
6
6
 
7
+ 3.15.1
8
+ ------
9
+ - Add TOC to configuration docs [#1298](https://github.com/puppetlabs/r10k/issues/1298)
10
+ - Remove the spec folder from gemspec [#1316](https://github.com/puppetlabs/r10k/issues/1316)
11
+
12
+ 3.15.0
13
+ ------
14
+
15
+ - Support and test Ruby 3
16
+ - Allow puppet_forge 3.x & newer versions of fast_gettext/gettext [#1302](https://github.com/puppetlabs/r10k/pull/1302)
17
+ - Allow newer cri versions [#1302](https://github.com/puppetlabs/r10k/pull/1302)
18
+ - Fix error when using install_path from environment module [#1288](https://github.com/puppetlabs/r10k/issues/1288)
19
+ - (RK-399) Do not warn about local modifications in the spec directory when `exclude_spec` is set [#1291](https://github.com/puppetlabs/r10k/pull/1291)
20
+
21
+ 3.14.2
22
+ ------
23
+
24
+ - (RK-397) Ensure `--incremental` does not skip undeployed modules [#1278](https://github.com/puppetlabs/r10k/pull/1278)
25
+
7
26
  3.14.1
8
27
  ------
9
28
 
data/CODEOWNERS CHANGED
@@ -1,2 +1,2 @@
1
- * @puppetlabs/puppetserver-maintainers
2
- /docker/ @puppetlabs/platform-services
1
+ # This repo is owned by the dumpling team
2
+ * @puppetlabs/dumpling
data/README.mkd CHANGED
@@ -18,7 +18,7 @@ Requirements
18
18
  ------------
19
19
 
20
20
  R10k supports the Ruby versions `>= 2.4.0`. It's tested on Ruby 2.4.0 up to
21
- Ruby 2.7.0 + Jruby.
21
+ Ruby 3.1.0 + Jruby.
22
22
 
23
23
  R10k requires additional components, depending on how you plan on managing
24
24
  environments and modules.
@@ -61,7 +61,7 @@ for installation.
61
61
  If you have more specific needs or plan on modifying r10k you can run it out of
62
62
  a git repository using Bundler for dependencies:
63
63
 
64
- git clone git://github.com/puppetlabs/r10k
64
+ git clone https://github.com/puppetlabs/r10k
65
65
  cd r10k
66
66
  bundle install
67
67
  bundle exec r10k help
@@ -1,6 +1,70 @@
1
1
  Dynamic Environment Configuration
2
2
  =================================
3
3
 
4
+ <!-- vim-markdown-toc GFM -->
5
+
6
+ * [Config file location](#config-file-location)
7
+ * [Manual configuration](#manual-configuration)
8
+ * [Automatic configuration](#automatic-configuration)
9
+ * [General options](#general-options)
10
+ * [cachedir](#cachedir)
11
+ * [proxy](#proxy)
12
+ * [pool_size](#pool_size)
13
+ * [git](#git)
14
+ * [provider](#provider)
15
+ * [proxy](#proxy-1)
16
+ * [username](#username)
17
+ * [private_key](#private_key)
18
+ * [oauth_token](#oauth_token)
19
+ * [repositories](#repositories)
20
+ * [private_key](#private_key-1)
21
+ * [oauth_token](#oauth_token-1)
22
+ * [proxy](#proxy-2)
23
+ * [forge](#forge)
24
+ * [proxy](#proxy-3)
25
+ * [baseurl](#baseurl)
26
+ * [authorization_token](#authorization_token)
27
+ * [allow_puppetfile_override](#allow_puppetfile_override)
28
+ * [Deployment options](#deployment-options)
29
+ * [postrun](#postrun)
30
+ * [sources](#sources)
31
+ * [deploy](#deploy)
32
+ * [purge\_levels](#purge_levels)
33
+ * [deployment](#deployment)
34
+ * [environment](#environment)
35
+ * [puppetfile](#puppetfile)
36
+ * [purge\_allowlist](#purge_allowlist)
37
+ * [write\_lock](#write_lock)
38
+ * [generate\_types](#generate_types)
39
+ * [puppet\_path](#puppet_path)
40
+ * [puppet\_conf](#puppet_conf)
41
+ * [exclude_spec](#exclude_spec)
42
+ * [Source options](#source-options)
43
+ * [remote](#remote)
44
+ * [basedir](#basedir)
45
+ * [prefix](#prefix)
46
+ * [prefix behaviour](#prefix-behaviour)
47
+ * [strip\_component](#strip_component)
48
+ * [strip\_component behaviour](#strip_component-behaviour)
49
+ * [ignore_branch_prefixes](#ignore_branch_prefixes)
50
+ * [ignore_branch_prefixes behaviour](#ignore_branch_prefixes-behaviour)
51
+ * [filter_command](#filter_command)
52
+ * [Examples](#examples)
53
+ * [Minimal example](#minimal-example)
54
+ * [Separate hiera data](#separate-hiera-data)
55
+ * [Multiple tenancy](#multiple-tenancy)
56
+ * [Multiple tenancy with external hieradata](#multiple-tenancy-with-external-hieradata)
57
+ * [Experimental Features](#experimental-features)
58
+ * [YAML Environment Source](#yaml-environment-source)
59
+ * [YAMLdir Environment Source](#yamldir-environment-source)
60
+ * [Exec environment Source](#exec-environment-source)
61
+ * [Environment Modules](#environment-modules)
62
+ * [Puppetfile module conflicts](#puppetfile-module-conflicts)
63
+ * [Plain Environment Type](#plain-environment-type)
64
+ * [Tarball Environment Type](#tarball-environment-type)
65
+
66
+ <!-- vim-markdown-toc -->
67
+
4
68
  R10k uses a configuration file to determine how dynamic environments should be
5
69
  deployed.
6
70
 
@@ -226,7 +290,7 @@ postrun: ['/usr/bin/curl', '-F', 'deploy=done', 'http://my-app.site/endpoint']
226
290
  The postrun setting can only be set once.
227
291
 
228
292
  Occurrences of the string `$modifiedenvs` in the postrun command will be
229
- replaced with the current environment(s) being deployed.
293
+ replaced with the current environment(s) being deployed, space separated.
230
294
 
231
295
  ### sources
232
296
 
@@ -398,13 +462,16 @@ specific documentation for more information.
398
462
  The 'remote' setting specifies where the source repository should be fetched
399
463
  from. It may be any valid URL that the source may check out or clone. The remote
400
464
  must be able to be fetched without any interactive input, eg usernames or
401
- passwords cannot be prompted for in order to fetch the remote.
465
+ passwords cannot be prompted for in order to fetch the remote. We support the
466
+ `git`, `ssh`, and `https` transport protocols. An SSH private key or access
467
+ token must be provided for authentication. Only `https` may be used without
468
+ authentication. See [GitHub's blog on protocol security](https://github.blog/2021-09-01-improving-git-protocol-security-github/) for more info.
402
469
 
403
470
  ```yaml
404
471
  ---
405
472
  sources:
406
473
  mysource:
407
- remote: 'git://git-server.site/my-org/main-modules'
474
+ remote: 'https://git-server.site/my-org/main-modules'
408
475
  ```
409
476
 
410
477
  ### basedir
@@ -522,7 +589,7 @@ hiera data files are kept. In this case you will specify a single source:
522
589
  ---
523
590
  sources:
524
591
  operations:
525
- remote: 'git://git-server.site/my-org/org-modules'
592
+ remote: 'https://git-server.site/my-org/org-modules'
526
593
  basedir: '/etc/puppet/environments'
527
594
  ```
528
595
 
@@ -535,10 +602,10 @@ repository and your modules in another repository, you can specify two sources:
535
602
  ---
536
603
  sources:
537
604
  operations:
538
- remote: 'git://git-server.site/my-org/org-modules'
605
+ remote: 'https://git-server.site/my-org/org-modules'
539
606
  basedir: '/etc/puppet/environments'
540
607
  hiera:
541
- remote: 'git://git-server.site/my-org/org-hiera-data'
608
+ remote: 'https://git-server.site/my-org/org-hiera-data'
542
609
  basedir: '/etc/puppet/hiera-data'
543
610
  ```
544
611
 
@@ -553,15 +620,15 @@ not the modules of other groups.
553
620
  ---
554
621
  sources:
555
622
  main:
556
- remote: 'git://git-server.site/my-org/main-modules'
623
+ remote: 'https://git-server.site/my-org/main-modules'
557
624
  basedir: '/etc/puppet/environments'
558
625
  prefix: false # Prefix defaults to false so this is only here for clarity
559
626
  qa:
560
- remote: 'git://git-server.site/my-org/qa-puppet-modules'
627
+ remote: 'https://git-server.site/my-org/qa-puppet-modules'
561
628
  basedir: '/etc/puppet/environments'
562
629
  prefix: true
563
630
  dev:
564
- remote: 'git://git-server.site/my-org/dev-puppet-modules'
631
+ remote: 'https://git-server.site/my-org/dev-puppet-modules'
565
632
  basedir: '/etc/puppet/environments'
566
633
  prefix: true
567
634
  ```
@@ -587,11 +654,11 @@ must override the `prefix` so environment folders line up in both directories:
587
654
  ---
588
655
  sources:
589
656
  app1_data:
590
- remote: 'git://git-server.site/my-org/app1-hieradata'
657
+ remote: 'https://git-server.site/my-org/app1-hieradata'
591
658
  basedir: '/etc/puppet/hieradata'
592
659
  prefix: "app1"
593
660
  app1_modules:
594
- remote: 'git://git-server.site/my-org/app1-puppet-modules'
661
+ remote: 'https://git-server.site/my-org/app1-puppet-modules'
595
662
  basedir: '/etc/puppet/environments'
596
663
  prefix: "app1"
597
664
  ```
@@ -84,6 +84,10 @@ explicit, static version. These are released Forge versions, or Git modules usin
84
84
  the `:tag`, or `:commit` keys. Git `:ref`s containing only the full 40 character
85
85
  commit SHA will also be treated as static versions. Then invoke a deploy with:
86
86
 
87
+ There may be issues with deployments apparently successful after an initial errored
88
+ deployment. If this is happening, try running without the `--incremental` flag
89
+ to run a full deployment.
90
+
87
91
  r10k deploy environment production --modules --incremental
88
92
 
89
93
  - - -
@@ -38,7 +38,7 @@ mod "puppetlabs/ntp"
38
38
 
39
39
  # Your modules:
40
40
  mod "custom_facts",
41
- :git => "git://github.com/user/custom_facts"
41
+ :git => "https://github.com/user/custom_facts"
42
42
  ```
43
43
 
44
44
  For any existing modules that you branched, add a reference to the new branch
@@ -46,7 +46,7 @@ name. Don't forget the comma at the end of the *:git* value.
46
46
 
47
47
  ```
48
48
  mod "other_module",
49
- :git => "git://github.com/user/other_module",
49
+ :git => "https://github.com/user/other_module",
50
50
  :ref => "feature"
51
51
  ```
52
52
 
@@ -159,7 +159,7 @@ the *:git* value.
159
159
 
160
160
  ```
161
161
  mod "other_module",
162
- :git => "git://github.com/user/other_module",
162
+ :git => "https://github.com/user/other_module",
163
163
  :ref => "feature"
164
164
  ```
165
165
 
data/doc/faq.mkd CHANGED
@@ -17,7 +17,7 @@ modify. For example creating the script:
17
17
 
18
18
  ```
19
19
  $ cat /usr/local/bin/generate-puppet-types.sh
20
- !#/bin/bash
20
+ #!/bin/bash
21
21
 
22
22
  for environment in $1; do
23
23
  /opt/puppetlabs/bin/puppet generate types --environment $environment
data/docker/Makefile CHANGED
@@ -7,6 +7,10 @@ hadolint_available := $(shell hadolint --help > /dev/null 2>&1; echo $$?)
7
7
  hadolint_command := hadolint
8
8
  hadolint_container := ghcr.io/hadolint/hadolint:latest
9
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
10
14
  export BUNDLE_PATH = $(PWD)/.bundle/gems
11
15
  export BUNDLE_BIN = $(PWD)/.bundle/bin
12
16
  export GEMFILE = $(PWD)/Gemfile
@@ -32,6 +36,10 @@ else
32
36
  dockerfile_context := $(PWD)/..
33
37
  endif
34
38
 
39
+ ifeq ($(IS_LATEST),true)
40
+ latest_tag := --tag $(NAMESPACE)/r10k:$(LATEST_VERSION)
41
+ endif
42
+
35
43
  prep:
36
44
  @git fetch --unshallow 2> /dev/null ||:
37
45
  @git fetch origin 'refs/tags/*:refs/tags/*'
@@ -52,17 +60,15 @@ build: prep
52
60
  docker pull alpine:$(alpine_version)
53
61
  docker buildx build \
54
62
  ${DOCKER_BUILD_FLAGS} \
55
- --load \
63
+ --output=type=$(output_type) \
64
+ --platform $(platform) \
56
65
  --build-arg alpine_version=$(alpine_version) \
57
66
  --build-arg vcs_ref=$(vcs_ref) \
58
67
  --build-arg build_date=$(build_date) \
59
68
  --build-arg version=$(VERSION) \
60
69
  --build-arg pupperware_analytics_stream=$(PUPPERWARE_ANALYTICS_STREAM) \
61
70
  --file r10k/$(dockerfile) \
62
- --tag $(NAMESPACE)/r10k:$(VERSION) $(dockerfile_context)
63
- ifeq ($(IS_LATEST),true)
64
- @docker tag $(NAMESPACE)/r10k:$(VERSION) puppet/r10k:$(LATEST_VERSION)
65
- endif
71
+ --tag $(NAMESPACE)/r10k:$(VERSION) $(latest_tag) $(dockerfile_context)
66
72
 
67
73
  test: prep
68
74
  @bundle install --path $$BUNDLE_PATH --gemfile $$GEMFILE --with test
@@ -71,11 +77,12 @@ test: prep
71
77
  bundle exec --gemfile $$GEMFILE \
72
78
  rspec spec
73
79
 
74
- push-image: prep
75
- @docker push $(NAMESPACE)/r10k:$(VERSION)
76
- ifeq ($(IS_LATEST),true)
77
- @docker push $(NAMESPACE)/r10k:$(LATEST_VERSION)
78
- endif
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
79
86
 
80
87
  push-readme:
81
88
  @docker pull sheogorath/readme-to-dockerhub
@@ -16,7 +16,7 @@ r10k_config_bak_path = "#{r10k_config_path}.bak"
16
16
 
17
17
  puppetfile =<<-EOS
18
18
  mod 'motd',
19
- :git => 'git://github.com/puppetlabs/puppetlabs-motd'
19
+ :git => 'https://github.com/puppetlabs/puppetlabs-motd'
20
20
  EOS
21
21
 
22
22
  proxy_env_value = 'http://cattastic.net:3219'
@@ -29,11 +29,11 @@ CONF
29
29
  # Install the same module in two different places
30
30
  puppetfile = <<-EOS
31
31
  mod 'prod_apache',
32
- :git => 'git://github.com/puppetlabs/puppetlabs-apache.git',
32
+ :git => 'https://github.com/puppetlabs/puppetlabs-apache.git',
33
33
  :tag => 'v6.0.0'
34
34
 
35
35
  mod 'test_apache',
36
- :git => 'git://github.com/puppetlabs/puppetlabs-apache.git',
36
+ :git => 'https://github.com/puppetlabs/puppetlabs-apache.git',
37
37
  :tag => 'v6.0.0'
38
38
  EOS
39
39
 
@@ -30,12 +30,12 @@ CONF
30
30
  puppetfile = <<-EOS
31
31
  mod 'non_module_object_1',
32
32
  :install_path => './',
33
- :git => 'git://github.com/puppetlabs/control-repo.git',
33
+ :git => 'https://github.com/puppetlabs/control-repo.git',
34
34
  :branch => 'production'
35
35
 
36
36
  mod 'non_module_object_2',
37
37
  :install_path => '',
38
- :git => 'git://github.com/puppetlabs/control-repo.git',
38
+ :git => 'https://github.com/puppetlabs/control-repo.git',
39
39
  :branch => 'production'
40
40
  EOS
41
41
 
@@ -27,7 +27,7 @@ stdlib_notify_message_regex = /The test message is:.*one.*=>.*1.*two.*=>.*bats.*
27
27
  puppet_file = <<-PUPPETFILE
28
28
  mod "puppetlabs/motd"
29
29
  mod 'puppetlabs/stdlib',
30
- :git => 'git://github.com/puppetlabs/puppetlabs-stdlib.git',
30
+ :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git',
31
31
  :tag => 'v7.0.1'
32
32
  PUPPETFILE
33
33
 
@@ -31,7 +31,7 @@ puppet_file = <<-PUPPETFILE
31
31
  moduledir '#{@module_path}'
32
32
  mod "puppetlabs/motd"
33
33
  mod 'puppetlabs/stdlib',
34
- :git => 'git://github.com/puppetlabs/puppetlabs-stdlib.git',
34
+ :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git',
35
35
  :tag => 'v7.0.1'
36
36
  PUPPETFILE
37
37
 
@@ -65,7 +65,7 @@ env_structs = {:production => GitEnv.new('/git_repos',
65
65
  '/git_repos_alt/environments_alt.git',
66
66
  '/root/environments_alt',
67
67
  '/root/environments_alt/Puppetfile',
68
- 'mod "puppetlabs/stdlib", :git => "git://github.com/puppetlabs/puppetlabs-stdlib.git", :tag => "v7.0.1"',
68
+ 'mod "puppetlabs/stdlib", :git => "https://github.com/puppetlabs/puppetlabs-stdlib.git", :tag => "v7.0.1"',
69
69
  '/root/environments_alt/manifests/site.pp',
70
70
  create_site_pp(master_certname, stage_env_manifest)
71
71
  ),
@@ -15,7 +15,7 @@ r10k_fqp = get_r10k_fqp(master)
15
15
 
16
16
  #File
17
17
  puppet_file = <<-PUPPETFILE
18
- mod 'broken', :git => 'git://github.com/puppetlabs/puppetlabs-broken'
18
+ mod 'broken', :git => 'https://github.com/puppetlabs/puppetlabs-broken'
19
19
  PUPPETFILE
20
20
 
21
21
  puppet_file_path = File.join(git_environments_path, 'Puppetfile')
@@ -12,7 +12,7 @@ r10k_fqp = get_r10k_fqp(master)
12
12
  #File
13
13
  puppet_file = <<-PUPPETFILE
14
14
  mod 'broken',
15
- :git => 'git://github.com/puppetlabs/puppetlabs-motd',
15
+ :git => 'https://github.com/puppetlabs/puppetlabs-motd',
16
16
  :ref => 'does_not_exist'
17
17
  PUPPETFILE
18
18
 
@@ -28,7 +28,7 @@ notify_message_regex = /I am in the production environment/
28
28
  puppet_file = <<-PUPPETFILE
29
29
  mod "puppetlabs/motd"
30
30
  mod 'puppetlabs/inifile',
31
- :git => 'git://github.com/puppetlabs/puppetlabs-inifile',
31
+ :git => 'https://github.com/puppetlabs/puppetlabs-inifile',
32
32
  :tag => 'v5.0.1'
33
33
  PUPPETFILE
34
34
 
@@ -27,7 +27,7 @@ PUPPETFILE
27
27
 
28
28
  puppet_file_git = <<-PUPPETFILE
29
29
  mod "puppetlabs/motd",
30
- :git => 'git://github.com/puppetlabs/puppetlabs-motd',
30
+ :git => 'https://github.com/puppetlabs/puppetlabs-motd',
31
31
  :tag => '1.2.0'
32
32
  PUPPETFILE
33
33
 
@@ -103,6 +103,29 @@ class R10K::Environment::WithModules < R10K::Environment::Base
103
103
  end
104
104
  end
105
105
 
106
+ def resolve_path(base, dirname, path)
107
+ if Pathname.new(path).absolute?
108
+ cleanpath(path)
109
+ else
110
+ cleanpath(File.join(base, dirname, path))
111
+ end
112
+ end
113
+
114
+ # .cleanpath is as good as we can do without touching the filesystem.
115
+ # The .realpath methods will choke if some of the intermediate paths
116
+ # are missing, even though in some cases we will create them later as
117
+ # needed.
118
+ def cleanpath(path)
119
+ Pathname.new(path).cleanpath.to_s
120
+ end
121
+
122
+ def validate_install_path(path, modname)
123
+ unless /^#{Regexp.escape(@basedir)}.*/ =~ path
124
+ raise R10K::Error.new("Environment cannot manage content '#{modname}' outside of containing environment: #{path} is not within #{@basedir}")
125
+ end
126
+ true
127
+ end
128
+
106
129
  # @param [String] name
107
130
  # @param [Hash] args
108
131
  def add_module(name, args)
@@ -111,7 +134,7 @@ class R10K::Environment::WithModules < R10K::Environment::Base
111
134
  args[:overrides] = @overrides
112
135
 
113
136
  if install_path = args.delete(:install_path)
114
- install_path = resolve_install_path(install_path)
137
+ install_path = resolve_path(@basedir, @dirname, install_path)
115
138
  validate_install_path(install_path, name)
116
139
  else
117
140
  install_path = @moduledir
@@ -75,6 +75,13 @@ class R10K::Git::Rugged::ThinRepository < R10K::Git::Rugged::WorkingRepository
75
75
  end
76
76
  end
77
77
 
78
+ def stage_files(files=['.'])
79
+ with_repo do |repo|
80
+ index = repo.index
81
+ files.each { |p| index.add( :path => p ) }
82
+ end
83
+ end
84
+
78
85
  private
79
86
 
80
87
  # Override the parent class repo setup so that we can make sure the alternates file is up to date
@@ -117,11 +117,15 @@ class R10K::Git::Rugged::WorkingRepository < R10K::Git::Rugged::BaseRepository
117
117
  with_repo { |repo| repo.config['remote.origin.url'] }
118
118
  end
119
119
 
120
- def dirty?
120
+ def dirty?(exclude_spec=false)
121
121
  with_repo do |repo|
122
- diff = repo.diff_workdir('HEAD')
122
+ if exclude_spec
123
+ diff = repo.diff_workdir('HEAD').select { |d| ! d.delta.old_file[:path].start_with?('spec/') }
124
+ else
125
+ diff = repo.diff_workdir('HEAD').to_a
126
+ end
123
127
 
124
- diff.each_patch do |p|
128
+ diff.each do |p|
125
129
  logger.debug(_("Found local modifications in %{file_path}" % {file_path: File.join(@path, p.delta.old_file[:path])}))
126
130
  logger.debug1(p.to_s)
127
131
  end
@@ -43,6 +43,10 @@ class R10K::Git::ShellGit::ThinRepository < R10K::Git::ShellGit::WorkingReposito
43
43
  git(['ls-tree', '-t', '-r', '--name-only', ref], :path => @path.to_s).stdout.split("\n")
44
44
  end
45
45
 
46
+ def stage_files(files=['.'])
47
+ git(['add', files].flatten, :path => @path.to_s)
48
+ end
49
+
46
50
  private
47
51
 
48
52
  def setup_cache_remote
@@ -90,11 +90,12 @@ class R10K::Git::ShellGit::WorkingRepository < R10K::Git::ShellGit::BaseReposito
90
90
  end
91
91
 
92
92
  # does the working tree have local modifications to tracked files?
93
- def dirty?
93
+ def dirty?(exclude_spec=false)
94
94
  result = git(['diff-index', '--exit-code', '--name-only', 'HEAD'], :path => @path.to_s, :raise_on_fail => false)
95
95
 
96
96
  if result.exit_code != 0
97
97
  dirty_files = result.stdout.split('\n')
98
+ dirty_files.delete_if { |f| f.start_with?('spec/') } if exclude_spec
98
99
 
99
100
  dirty_files.each do |file|
100
101
  logger.debug(_("Found local modifications in %{file_path}" % {file_path: File.join(@path, file)}))
@@ -103,7 +104,7 @@ class R10K::Git::ShellGit::WorkingRepository < R10K::Git::ShellGit::BaseReposito
103
104
  logger.debug1 { git(['diff-index', '-p', 'HEAD', file], :path => @path.to_s, :raise_on_fail => false).stdout }
104
105
  end
105
106
 
106
- return true
107
+ return dirty_files.size > 0
107
108
  else
108
109
  return false
109
110
  end
@@ -36,7 +36,7 @@ class R10K::Git::StatefulRepository
36
36
  end
37
37
 
38
38
  # Returns true if the sync actually updated the repo, false otherwise
39
- def sync(ref, force=true)
39
+ def sync(ref, force=true, exclude_spec=false)
40
40
  @cache.sync if sync_cache?(ref)
41
41
 
42
42
  sha = @cache.resolve(ref)
@@ -45,7 +45,7 @@ class R10K::Git::StatefulRepository
45
45
  raise R10K::Git::UnresolvableRefError.new(_("Unable to sync repo to unresolvable ref '%{ref}'") % {ref: ref}, :git_dir => @repo.git_dir)
46
46
  end
47
47
 
48
- workdir_status = status(ref)
48
+ workdir_status = status(ref, exclude_spec)
49
49
 
50
50
  updated = true
51
51
  case workdir_status
@@ -75,7 +75,7 @@ class R10K::Git::StatefulRepository
75
75
  updated
76
76
  end
77
77
 
78
- def status(ref)
78
+ def status(ref, exclude_spec=false)
79
79
  if !@repo.exist?
80
80
  :absent
81
81
  elsif !@cache.exist?
@@ -88,7 +88,7 @@ class R10K::Git::StatefulRepository
88
88
  :mismatched
89
89
  elsif @repo.head.nil?
90
90
  :mismatched
91
- elsif @repo.dirty?
91
+ elsif @repo.dirty?(exclude_spec)
92
92
  :dirty
93
93
  elsif !(@repo.head == @cache.resolve(ref))
94
94
  :outdated
@@ -100,7 +100,7 @@ class R10K::Module::Git < R10K::Module::Base
100
100
  def sync(opts={})
101
101
  force = opts[:force] || @force
102
102
  if should_sync?
103
- updated = @repo.sync(version, force)
103
+ updated = @repo.sync(version, force, @exclude_spec)
104
104
  else
105
105
  updated = false
106
106
  end
@@ -157,11 +157,14 @@ module R10K
157
157
  return @modules
158
158
  end
159
159
 
160
- # If this module's metadata has a static version and that version
161
- # matches the existing module declaration use it, otherwise create
162
- # a regular module to sync.
163
- unless mod.version && (mod.version == @existing_module_versions_by_name[mod.name])
164
- mod = mod.to_implementation
160
+ # If this module's metadata has a static version, and that version
161
+ # matches the existing module declaration, and it ostensibly
162
+ # has already has been deployed to disk, use it. Otherwise create a
163
+ # regular module to sync.
164
+ unless mod.version &&
165
+ mod.version == @existing_module_versions_by_name[mod.name] &&
166
+ File.directory?(mod.path)
167
+ mod = mod.to_implementation
165
168
  end
166
169
 
167
170
  @modules << mod
@@ -1,3 +1,4 @@
1
+ require 'set'
1
2
  # Defines a collection for application settings
2
3
  #
3
4
  # This implements a hierarchical interface to application settings. Containers
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.14.1'
5
+ VERSION = '3.15.1'
6
6
  end