r10k 3.15.4 → 3.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) 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 +2 -2
  5. data/.github/workflows/rspec_tests.yml +7 -7
  6. data/.github/workflows/stale.yml +1 -1
  7. data/CHANGELOG.mkd +8 -0
  8. data/Gemfile +2 -2
  9. data/integration/files/pre-suite/git_config.pp.erb +1 -1
  10. data/integration/pre-suite/10_git_config.rb +0 -3
  11. data/integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb +5 -4
  12. data/integration/tests/basic_functionality/proxy_specified_in_configuration.rb +1 -1
  13. data/integration/tests/basic_functionality/proxy_with_puppetfile.rb +1 -1
  14. data/integration/tests/command_line/deploy_env_without_mod_update.rb +0 -3
  15. data/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb +0 -3
  16. data/integration/tests/git_source/HTTP_proxy_and_git_source.rb +5 -10
  17. data/integration/tests/git_source/git_source_git.rb +0 -3
  18. data/integration/tests/git_source/git_source_repeated_remote.rb +0 -3
  19. data/integration/tests/git_source/negative/neg_git_unauthorized_ssh.rb +1 -1
  20. data/integration/tests/purging/content_not_purged_at_root.rb +0 -3
  21. data/integration/tests/purging/default_purging.rb +0 -3
  22. data/integration/tests/purging/does_not_purge_files_on_white_list.rb +0 -3
  23. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +0 -3
  24. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +0 -3
  25. data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +0 -3
  26. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb +0 -3
  27. data/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +0 -3
  28. data/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb +3 -2
  29. data/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb +1 -5
  30. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +0 -3
  31. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb +0 -3
  32. data/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb +0 -3
  33. data/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb +0 -3
  34. data/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb +0 -3
  35. data/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb +0 -3
  36. data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +0 -3
  37. data/lib/r10k/content_synchronizer.rb +7 -2
  38. data/lib/r10k/git/rugged/bare_repository.rb +4 -3
  39. data/lib/r10k/git/rugged/working_repository.rb +6 -4
  40. data/lib/r10k/puppetfile.rb +1 -1
  41. data/lib/r10k/version.rb +1 -1
  42. data/locales/r10k.pot +10 -6
  43. data/r10k.gemspec +1 -1
  44. metadata +11 -22
  45. data/docker/.gitignore +0 -1
  46. data/docker/.rspec +0 -4
  47. data/docker/Gemfile +0 -11
  48. data/docker/Makefile +0 -99
  49. data/docker/README.md +0 -28
  50. data/docker/docker-compose.yml +0 -18
  51. data/docker/r10k/Dockerfile +0 -68
  52. data/docker/r10k/adduser.sh +0 -13
  53. data/docker/r10k/docker-entrypoint.d/10-analytics.sh +0 -30
  54. data/docker/r10k/docker-entrypoint.sh +0 -10
  55. data/docker/r10k/release.Dockerfile +0 -55
  56. data/docker/spec/dockerfile_spec.rb +0 -37
  57. data/docker/spec/fixtures/Puppetfile +0 -2
  58. data/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb +0 -83
  59. data/integration/tests/basic_functionality/proxy_with_pe_only_module.rb +0 -128
  60. data/integration/tests/purging/invalid_whitelist_types.rb +0 -63
  61. data/integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb +0 -49
  62. data/integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb +0 -68
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.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Thebo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-19 00:00:00.000000000 Z
11
+ date: 2023-07-26 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
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
@@ -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