r10k 2.6.4 → 2.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +1 -0
- data/CHANGELOG.mkd +14 -0
- data/azure-pipelines.yml +72 -0
- data/docker/.rspec +3 -0
- data/docker/Gemfile +14 -0
- data/docker/ci/build +72 -0
- data/docker/ci/build.ps1 +38 -0
- data/docker/distelli-manifest.yml +4 -0
- data/docker/r10k/Dockerfile +41 -0
- data/docker/r10k/spec/dockerfile_spec.rb +24 -0
- data/lib/r10k/util/subprocess/runner/posix.rb +3 -3
- data/lib/r10k/version.rb +1 -1
- data/test +1 -1
- metadata +12 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e316da30e6d2243053c1dbcfd77b1035119a2dc
|
4
|
+
data.tar.gz: 1e7389b26a3ed22b5aad90d913fa56f5d015fe8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19d33447cf4ea83af051fe1edda24b84631c3b03160c02594d857799825665f13edbb23727be187f2ae102e4fc57cdcf889e55e564c423306b3e3b45ac6e471e
|
7
|
+
data.tar.gz: a0b7bdb7c82df31ad3afe81ceff091e023137a17dfaec775cd6dad3d0ca29da449bc6d21197e442109519ce65e2dab5f63db2982df5da543c61efb7da2665852
|
data/.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
docker/r10k/* text eol=lf
|
data/CHANGELOG.mkd
CHANGED
data/azure-pipelines.yml
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
pool:
|
2
|
+
# self-hosted agent on Windows 10 1709 environment
|
3
|
+
# includes newer Docker engine with LCOW enabled, new build of LCOW image
|
4
|
+
# includes Ruby 2.5, Go 1.10, Node.js 10.10, hadolint
|
5
|
+
name: Default
|
6
|
+
|
7
|
+
variables:
|
8
|
+
BUILD_REPOSITORY: 127.0.0.1
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- powershell: |
|
12
|
+
$line = '=' * 80
|
13
|
+
Write-Host "$line`nWindows`n$line`n"
|
14
|
+
Get-ComputerInfo |
|
15
|
+
select WindowsProductName, WindowsVersion, OsHardwareAbstractionLayer |
|
16
|
+
Out-String |
|
17
|
+
Write-Host
|
18
|
+
#
|
19
|
+
# Azure
|
20
|
+
#
|
21
|
+
Write-Host "`n`n$line`nAzure`n$line`n"
|
22
|
+
Invoke-RestMethod -Headers @{'Metadata'='true'} -URI http://169.254.169.254/metadata/instance?api-version=2017-12-01 -Method Get |
|
23
|
+
ConvertTo-Json -Depth 10 |
|
24
|
+
Write-Host
|
25
|
+
#
|
26
|
+
# Docker
|
27
|
+
#
|
28
|
+
Write-Host "`n`n$line`nDocker`n$line`n"
|
29
|
+
docker version
|
30
|
+
docker images
|
31
|
+
docker info
|
32
|
+
sc.exe qc docker
|
33
|
+
#
|
34
|
+
# Ruby
|
35
|
+
#
|
36
|
+
Write-Host "`n`n$line`nRuby`n$line`n"
|
37
|
+
ruby --version
|
38
|
+
gem --version
|
39
|
+
bundle --version
|
40
|
+
#
|
41
|
+
# Environment
|
42
|
+
#
|
43
|
+
Write-Host "`n`n$line`nEnvironment`n$line`n"
|
44
|
+
Get-ChildItem Env: | % { Write-Host "$($_.Key): $($_.Value)" }
|
45
|
+
displayName: Diagnostic Host Information
|
46
|
+
name: hostinfo
|
47
|
+
- powershell: |
|
48
|
+
. ./docker/ci/build.ps1
|
49
|
+
Invoke-ContainerBuildSetup
|
50
|
+
displayName: Prepare Build Environment
|
51
|
+
name: build_prepare
|
52
|
+
- powershell: |
|
53
|
+
. ./docker/ci/build.ps1
|
54
|
+
Build-Container -Name r10k -Repository $ENV:BUILD_REPOSITORY
|
55
|
+
displayName: Build r10k
|
56
|
+
name: build_r10k
|
57
|
+
- powershell: |
|
58
|
+
. ./docker/ci/build.ps1
|
59
|
+
Invoke-ContainerTest -Name r10k -Repository $ENV:BUILD_REPOSITORY
|
60
|
+
displayName: Test r10k
|
61
|
+
name: test_r10k
|
62
|
+
- task: PublishTestResults@2
|
63
|
+
displayName: Publish r10k test results
|
64
|
+
inputs:
|
65
|
+
testResultsFormat: 'JUnit'
|
66
|
+
testResultsFiles: 'docker/**/TEST-*.xml'
|
67
|
+
testRunTitle: r10k Test Results
|
68
|
+
- powershell: |
|
69
|
+
. ./docker/ci/build.ps1
|
70
|
+
Clear-ContainerBuilds
|
71
|
+
displayName: Container Cleanup
|
72
|
+
condition: always()
|
data/docker/.rspec
ADDED
data/docker/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source ENV['GEM_SOURCE'] || "https://rubygems.org"
|
2
|
+
|
3
|
+
def location_for(place, fake_version = nil)
|
4
|
+
if place =~ /^((?:git|https?)[:@][^#]*)#(.*)/
|
5
|
+
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
|
6
|
+
elsif place =~ /^file:\/\/(.*)/
|
7
|
+
['>= 0', { :path => File.expand_path($1), :require => false }]
|
8
|
+
else
|
9
|
+
[place, { :require => false }]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
gem 'puppet_docker_tools', *location_for(ENV['PUPPET_DOCKER_LOCATION'] || '~> 0.2')
|
14
|
+
gem 'rspec_junit_formatter'
|
data/docker/ci/build
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
set -eux
|
4
|
+
|
5
|
+
PATH=$PATH:/usr/local/bin
|
6
|
+
BUNDLER_PATH=.bundle/gems
|
7
|
+
|
8
|
+
function build_and_test_image() {
|
9
|
+
container_name="$1"
|
10
|
+
|
11
|
+
: ===
|
12
|
+
: === run linter on the docker files
|
13
|
+
: ===
|
14
|
+
bundle exec puppet-docker local-lint "$container_name"
|
15
|
+
|
16
|
+
: ===
|
17
|
+
: === build and test $container_name
|
18
|
+
: ===
|
19
|
+
bundle exec puppet-docker build "$container_name" --no-cache --repository puppet --version "$version" --no-latest
|
20
|
+
bundle exec puppet-docker spec "$container_name" --image "puppet/$container_name:$version"
|
21
|
+
}
|
22
|
+
|
23
|
+
function push_image() {
|
24
|
+
container_name="$1"
|
25
|
+
container_version="$2"
|
26
|
+
: ===
|
27
|
+
: === push $container_name
|
28
|
+
: ===
|
29
|
+
bundle exec puppet-docker push "$container_name" --repository puppet --version "$container_version" --no-latest
|
30
|
+
}
|
31
|
+
|
32
|
+
: ===
|
33
|
+
: === bundle install to get ready
|
34
|
+
: ===
|
35
|
+
bundle install --path "$BUNDLER_PATH"
|
36
|
+
|
37
|
+
: ===
|
38
|
+
: === If we do not git pull --unshallow we get really weird results with git describe
|
39
|
+
: ===
|
40
|
+
git pull --unshallow
|
41
|
+
|
42
|
+
: ===
|
43
|
+
: === make sure we fetch tags for versioning
|
44
|
+
: ===
|
45
|
+
git fetch origin 'refs/tags/*:refs/tags/*'
|
46
|
+
git_describe=`git describe`
|
47
|
+
version="${git_describe%%-*}"
|
48
|
+
|
49
|
+
: ===
|
50
|
+
: === pull updated base images
|
51
|
+
: ===
|
52
|
+
bundle exec puppet-docker update-base-images ubuntu:16.04
|
53
|
+
|
54
|
+
container_list=(r10k)
|
55
|
+
|
56
|
+
: ===
|
57
|
+
: === build and test all the images before we push anything
|
58
|
+
: ===
|
59
|
+
for container in "${container_list[@]}"; do
|
60
|
+
build_and_test_image "$container"
|
61
|
+
done
|
62
|
+
|
63
|
+
: ===
|
64
|
+
: === push all the images
|
65
|
+
: ===
|
66
|
+
for container in "${container_list[@]}"; do
|
67
|
+
push_image "$container" "$version"
|
68
|
+
done
|
69
|
+
|
70
|
+
: ===
|
71
|
+
: === SUCCESS
|
72
|
+
: ===
|
data/docker/ci/build.ps1
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
$ErrorActionPreference = 'Stop'
|
2
|
+
|
3
|
+
function Get-CurrentDirectory
|
4
|
+
{
|
5
|
+
$thisName = $MyInvocation.MyCommand.Name
|
6
|
+
[IO.Path]::GetDirectoryName((Get-Content function:$thisName).File)
|
7
|
+
}
|
8
|
+
|
9
|
+
# installs gems for build and test and grabs base images
|
10
|
+
function Invoke-ContainerBuildSetup
|
11
|
+
{
|
12
|
+
Push-Location (Get-CurrentDirectory)
|
13
|
+
bundle install --path '.bundle/gems'
|
14
|
+
bundle exec puppet-docker update-base-images ubuntu:16.04
|
15
|
+
Pop-Location
|
16
|
+
}
|
17
|
+
|
18
|
+
function Build-Container($Name, $Repository = '127.0.0.1')
|
19
|
+
{
|
20
|
+
Push-Location (Join-Path (Get-CurrentDirectory) '..')
|
21
|
+
bundle exec puppet-docker local-lint $Name
|
22
|
+
bundle exec puppet-docker build $Name --no-cache --repository $Repository --build-arg namespace=$Repository
|
23
|
+
Pop-Location
|
24
|
+
}
|
25
|
+
|
26
|
+
function Invoke-ContainerTest($Name, $Repository = '127.0.0.1')
|
27
|
+
{
|
28
|
+
Push-Location (Join-Path (Get-CurrentDirectory) '..')
|
29
|
+
bundle exec puppet-docker spec $Name --image $Repository/$Name
|
30
|
+
Pop-Location
|
31
|
+
}
|
32
|
+
|
33
|
+
# removes any temporary containers / images used during builds
|
34
|
+
function Clear-ContainerBuilds
|
35
|
+
{
|
36
|
+
docker container prune --force
|
37
|
+
docker image prune --filter "dangling=true" --force
|
38
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
FROM ubuntu:16.04
|
2
|
+
|
3
|
+
ARG vcs_ref
|
4
|
+
ARG build_date
|
5
|
+
ARG version="2.6.4"
|
6
|
+
ENV R10K_VERSION="$version"
|
7
|
+
ENV UBUNTU_CODENAME="xenial"
|
8
|
+
|
9
|
+
LABEL org.label-schema.maintainer="Puppet Release Team <release@puppet.com>" \
|
10
|
+
org.label-schema.vendor="Puppet" \
|
11
|
+
org.label-schema.url="https://github.com/puppetlabs/r10k" \
|
12
|
+
org.label-schema.name="r10k" \
|
13
|
+
org.label-schema.license="Apache-2.0" \
|
14
|
+
org.label-schema.version="$R10K_VERSION" \
|
15
|
+
org.label-schema.vcs-url="https://github.com/puppetlabs/r10k" \
|
16
|
+
org.label-schema.vcs-ref="$vcs_ref" \
|
17
|
+
org.label-schema.build-date="$build_date" \
|
18
|
+
org.label-schema.schema-version="1.0" \
|
19
|
+
org.label-schema.dockerfile="/Dockerfile"
|
20
|
+
|
21
|
+
RUN apt-get update && \
|
22
|
+
apt-get install --no-install-recommends -y wget ca-certificates lsb-release && \
|
23
|
+
wget https://apt.puppetlabs.com/puppet5-release-"$UBUNTU_CODENAME".deb && \
|
24
|
+
dpkg -i puppet5-release-"$UBUNTU_CODENAME".deb && \
|
25
|
+
rm puppet5-release-"$UBUNTU_CODENAME".deb && \
|
26
|
+
apt-get update && \
|
27
|
+
apt-get install --no-install-recommends -y puppet-agent && \
|
28
|
+
apt-get install --no-install-recommends -y git openssh-client && \
|
29
|
+
apt-get remove --purge -y wget && \
|
30
|
+
apt-get autoremove -y && \
|
31
|
+
apt-get clean && \
|
32
|
+
rm -rf /var/lib/apt/lists/*
|
33
|
+
|
34
|
+
RUN /opt/puppetlabs/puppet/bin/gem install r10k:"$R10K_VERSION"
|
35
|
+
|
36
|
+
ENV PATH=/opt/puppetlabs/server/bin:/opt/puppetlabs/puppet/bin:/opt/puppetlabs/bin:$PATH
|
37
|
+
|
38
|
+
ENTRYPOINT ["/opt/puppetlabs/puppet/bin/r10k"]
|
39
|
+
CMD ["help"]
|
40
|
+
|
41
|
+
COPY Dockerfile /
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'puppet_docker_tools/spec_helper'
|
2
|
+
|
3
|
+
CURRENT_DIRECTORY = File.dirname(File.dirname(__FILE__))
|
4
|
+
|
5
|
+
describe 'Dockerfile' do
|
6
|
+
include_context 'with a docker image'
|
7
|
+
include_context 'with a docker container' do
|
8
|
+
def docker_run_options
|
9
|
+
'--entrypoint /bin/bash'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'uses the correct version of Ubuntu' do
|
14
|
+
it_should_behave_like 'a running container', 'cat /etc/lsb-release', nil, 'Ubuntu 16.04'
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'has puppet-agent installed' do
|
18
|
+
it_should_behave_like 'a running container', 'dpkg -l puppet-agent', 0
|
19
|
+
end
|
20
|
+
|
21
|
+
describe 'has /opt/puppetlabs/puppet/bin/r10k' do
|
22
|
+
it_should_behave_like 'a running container', 'stat -L /opt/puppetlabs/puppet/bin/r10k', 0, 'Access: \(0755\/\-rwxr\-xr\-x\)'
|
23
|
+
end
|
24
|
+
end
|
@@ -28,15 +28,15 @@ class R10K::Util::Subprocess::Runner::POSIX < R10K::Util::Subprocess::Runner
|
|
28
28
|
|
29
29
|
@stdout_pump = R10K::Util::Subprocess::Runner::Pump.new(@stdout_r)
|
30
30
|
@stderr_pump = R10K::Util::Subprocess::Runner::Pump.new(@stderr_r)
|
31
|
-
@stdout_pump.start
|
32
|
-
@stderr_pump.start
|
33
|
-
|
34
31
|
pid = fork do
|
35
32
|
exec_r.close
|
36
33
|
execute_child(exec_w)
|
37
34
|
end
|
38
35
|
|
39
36
|
exec_w.close
|
37
|
+
@stdout_pump.start
|
38
|
+
@stderr_pump.start
|
39
|
+
|
40
40
|
execute_parent(exec_r, pid)
|
41
41
|
|
42
42
|
@result
|
data/lib/r10k/version.rb
CHANGED
data/test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
integration
|
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: 2.6.
|
4
|
+
version: 2.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Thebo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|
@@ -160,6 +160,7 @@ executables:
|
|
160
160
|
extensions: []
|
161
161
|
extra_rdoc_files: []
|
162
162
|
files:
|
163
|
+
- ".gitattributes"
|
163
164
|
- ".gitignore"
|
164
165
|
- ".travis.yml"
|
165
166
|
- CHANGELOG.mkd
|
@@ -169,6 +170,7 @@ files:
|
|
169
170
|
- MAINTAINERS
|
170
171
|
- README.mkd
|
171
172
|
- Rakefile
|
173
|
+
- azure-pipelines.yml
|
172
174
|
- bin/r10k
|
173
175
|
- doc/common-patterns.mkd
|
174
176
|
- doc/dynamic-environments.mkd
|
@@ -185,6 +187,13 @@ files:
|
|
185
187
|
- doc/git/providers.mkd
|
186
188
|
- doc/puppetfile.mkd
|
187
189
|
- doc/updating-your-puppetfile.mkd
|
190
|
+
- docker/.rspec
|
191
|
+
- docker/Gemfile
|
192
|
+
- docker/ci/build
|
193
|
+
- docker/ci/build.ps1
|
194
|
+
- docker/distelli-manifest.yml
|
195
|
+
- docker/r10k/Dockerfile
|
196
|
+
- docker/r10k/spec/dockerfile_spec.rb
|
188
197
|
- integration/Gemfile
|
189
198
|
- integration/README.mkd
|
190
199
|
- integration/Rakefile
|
@@ -512,7 +521,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
512
521
|
version: '0'
|
513
522
|
requirements: []
|
514
523
|
rubyforge_project:
|
515
|
-
rubygems_version: 2.
|
524
|
+
rubygems_version: 2.5.1
|
516
525
|
signing_key:
|
517
526
|
specification_version: 4
|
518
527
|
summary: Puppet environment and module deployment
|