puppet_module_packaging 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +5 -0
- data/README.md +6 -2
- data/lib/puppet_module/pkg/tasks/system.rb +11 -3
- data/lib/puppet_module/pkg/version.rb +1 -1
- data/test/end_to_end/install_test.rb +28 -4
- data/test/fixture/testmod_small/Modulefile +2 -0
- data/test/fixture/testmod_small/Rakefile +3 -0
- data/test/fixture/testmod_small/manifests/init.pp +0 -0
- data/test/fixture/testmod_small/templates/config.erb +0 -0
- data/test/integration/system_test.rb +10 -0
- data/test/test_helper.rb +4 -0
- data.tar.gz.sig +0 -0
- metadata +9 -1
- metadata.gz.sig +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccc2278c587b1d85d0717646163e3725f8abc4a2
|
4
|
+
data.tar.gz: 3973f313a92372db4c5a2f9bfa136aa381392d3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05f80f6e6262799d7640c355f15885146962932cca63812526e5a2f852ff84996bd65f8327aa76a662fd1b2cba2c1f78079519723ae50bee34b4ec6998f8f1bb
|
7
|
+
data.tar.gz: d6f15dd4ba72dba9b29077feaec6a4f0e0c6e51fccd567d5309db62b45fdf1b08e2fbf131125e479df0af5d929754dbc5d3db61f482e34f9adf9cd7f7442b6b2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Puppet Module Packaging
|
2
2
|
|
3
3
|
[](https://travis-ci.org/stefanozanella/puppet_module_packaging)
|
4
|
+
[](http://badge.fury.io/rb/puppet_module_packaging)
|
5
|
+
[](https://gemnasium.com/stefanozanella/puppet_module_packaging)
|
4
6
|
|
5
7
|
Provides Rake tasks to ease shipping of Puppet modules as proper system
|
6
8
|
packages.
|
@@ -31,9 +33,11 @@ Or install it yourself as:
|
|
31
33
|
## Usage
|
32
34
|
|
33
35
|
To have the shipped Rake tasks available for your module, just add the
|
34
|
-
following
|
36
|
+
following lines to your `Rakefile`:
|
35
37
|
|
36
|
-
require '
|
38
|
+
require 'puppet_module/pkg/rake_task'
|
39
|
+
|
40
|
+
PuppetModule::Pkg::Tasks.new
|
37
41
|
|
38
42
|
This will add the following tasks to your set:
|
39
43
|
|
@@ -7,9 +7,7 @@ module PuppetModule
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def cp(src, dest)
|
10
|
-
|
11
|
-
|
12
|
-
FileUtils.cp_r sanitized_src, dest
|
10
|
+
FileUtils.cp_r only_existing_entries_of(ensure_array(src)), dest
|
13
11
|
end
|
14
12
|
|
15
13
|
def rm(path)
|
@@ -19,6 +17,16 @@ module PuppetModule
|
|
19
17
|
def sh(cmd)
|
20
18
|
`#{cmd}`
|
21
19
|
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def ensure_array(src)
|
24
|
+
src.is_a?(Range) ? src.to_a : src
|
25
|
+
end
|
26
|
+
|
27
|
+
def only_existing_entries_of(src)
|
28
|
+
src.select { |f| File.exists? f }
|
29
|
+
end
|
22
30
|
end
|
23
31
|
end
|
24
32
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
describe 'install task' do
|
4
|
-
around do |t|
|
5
|
-
do_into_tmp_module('testmod', t)
|
6
|
-
end
|
7
|
-
|
8
4
|
describe 'by default' do
|
5
|
+
around do |t|
|
6
|
+
do_into_tmp_module('testmod', t)
|
7
|
+
end
|
8
|
+
|
9
9
|
let(:output_dir) { 'build/usr/share/puppet/modules/testmod' }
|
10
10
|
|
11
11
|
it 'installs all module dirs into the `build` subfolder' do
|
@@ -31,4 +31,28 @@ describe 'install task' do
|
|
31
31
|
}.must_exist_within output_dir
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
# Issue #1
|
36
|
+
describe 'when not all standard module directories are present' do
|
37
|
+
around do |t|
|
38
|
+
do_into_tmp_module('testmod_small', t)
|
39
|
+
end
|
40
|
+
|
41
|
+
let(:output_dir) { 'build/usr/share/puppet/modules/testmod_small' }
|
42
|
+
|
43
|
+
it 'installs the module anyway' do
|
44
|
+
`rake install`
|
45
|
+
|
46
|
+
assert directory?(output_dir), "expected #{output_dir} to exist, but it didn't"
|
47
|
+
filesystem {
|
48
|
+
dir 'manifests' do
|
49
|
+
file 'init.pp'
|
50
|
+
end
|
51
|
+
|
52
|
+
dir 'templates' do
|
53
|
+
file 'config.erb'
|
54
|
+
end
|
55
|
+
}.must_exist_within output_dir
|
56
|
+
end
|
57
|
+
end
|
34
58
|
end
|
File without changes
|
File without changes
|
@@ -38,6 +38,16 @@ describe PuppetModule::Pkg::Tasks::System do
|
|
38
38
|
assert file?(join 'out', dir, "test_#{dir}"), "expected file out/#{dir}/test_#{dir} to exist"
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
it 'doesn`t complain if some directories are not found' do
|
43
|
+
mkdir 'directory'
|
44
|
+
mkdir 'out'
|
45
|
+
|
46
|
+
fs.cp(['directory', 'not', 'found'], 'out')
|
47
|
+
|
48
|
+
refute exists?(join 'out', 'not')
|
49
|
+
refute exists?(join 'out', 'found')
|
50
|
+
end
|
41
51
|
end
|
42
52
|
|
43
53
|
describe 'rm' do
|
data/test/test_helper.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet_module_packaging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Zanella
|
@@ -186,6 +186,10 @@ files:
|
|
186
186
|
- test/fixture/testmod/lib/utils.rb
|
187
187
|
- test/fixture/testmod/manifests/init.pp
|
188
188
|
- test/fixture/testmod/templates/config.erb
|
189
|
+
- test/fixture/testmod_small/Modulefile
|
190
|
+
- test/fixture/testmod_small/Rakefile
|
191
|
+
- test/fixture/testmod_small/manifests/init.pp
|
192
|
+
- test/fixture/testmod_small/templates/config.erb
|
189
193
|
- test/integration/modulefile_test.rb
|
190
194
|
- test/integration/system_test.rb
|
191
195
|
- test/test_helper.rb
|
@@ -232,6 +236,10 @@ test_files:
|
|
232
236
|
- test/fixture/testmod/lib/utils.rb
|
233
237
|
- test/fixture/testmod/manifests/init.pp
|
234
238
|
- test/fixture/testmod/templates/config.erb
|
239
|
+
- test/fixture/testmod_small/Modulefile
|
240
|
+
- test/fixture/testmod_small/Rakefile
|
241
|
+
- test/fixture/testmod_small/manifests/init.pp
|
242
|
+
- test/fixture/testmod_small/templates/config.erb
|
235
243
|
- test/integration/modulefile_test.rb
|
236
244
|
- test/integration/system_test.rb
|
237
245
|
- test/test_helper.rb
|
metadata.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
Z��s�@0�h����F�����h@>.��T�-�?���t���N�?q̢�����i�q!ݙ
|
1
|
+
5��R�h�i��}gg�A���"Q��d5@��}?�Sg�Z�+�m$t��9x!��@^�R�����ҟ��e�ڂͨ^��Ь��a�6�΄)ŝyR�5F�iDz���֊�3fl�ԅ�L����[Q����g)m��١,Yh~���v^c���k��2����r�(�(��F�mcG��z�6�Gv2���
|