puppet-magnum 4.0.1 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/generator_files/puppet/common.yaml.erb +1 -1
- data/generator_files/util/puppet-magnum.erb +4 -0
- data/lib/puppet-magnum.rb +7 -2
- data/lib/puppet-magnum/cli/module.rb +5 -0
- data/lib/puppet-magnum/generators/create_generator.rb +46 -14
- data/lib/puppet-magnum/utility/verify.rb +23 -0
- metadata +4 -3
- data/generator_files/util/puppet-magnum.init.erb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a030e0c24caedcd5eff49e87bb83756ecef462e8
|
4
|
+
data.tar.gz: 15b277f93c5f95517b7090d836c8ee308a2e89a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ed50a6d3674ceb5634cf85c19aee46e345a61424fa575fd3d176d19c4781654ab05c3f655efbec29a74a073b16eb81040b4f00ddffcaac086f95bfdd0150f4d
|
7
|
+
data.tar.gz: 982712d91e32b13cd3cdb4a887f6844df88c8720e4b96c014192e50eefd4f5048b5f3059ff61d0b0f339c9664fc92b27d7f7b0f307cf8909b1631dc2e887c813
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## [4.0.2]
|
2
|
+
|
3
|
+
### IMPROVEMENTS:
|
4
|
+
|
5
|
+
* Added a function to remove any unused files and directories in `puppet-magnum` 4.x.
|
6
|
+
This will make upgrading PM repos from 3.x to 4.x easier.
|
7
|
+
A `module init` using `puppet-magnum` 4.x will remove/rename the following files:
|
8
|
+
- .fixtures.yml (removed)
|
9
|
+
- .vagrant_puppet/ (removed)
|
10
|
+
- Vagrantfile (removed)
|
11
|
+
- spec => spec.old (renamed)
|
12
|
+
- serverspec => serverspec.old (renamed)
|
13
|
+
|
1
14
|
## [4.0.1]
|
2
15
|
|
3
16
|
### IMPROVEMENTS:
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.0.
|
1
|
+
4.0.2
|
@@ -1,2 +1,2 @@
|
|
1
1
|
---
|
2
|
-
<%= module_name %>::test_message: "
|
2
|
+
<%= module_name %>::test_message: "example"
|
data/lib/puppet-magnum.rb
CHANGED
@@ -2,12 +2,17 @@ require 'thor'
|
|
2
2
|
require 'pathname'
|
3
3
|
|
4
4
|
module PuppetMagnum
|
5
|
-
|
6
|
-
autoload :CreateGenerator, 'puppet-magnum/generators/create_generator'
|
5
|
+
|
7
6
|
autoload :Cli, 'puppet-magnum/cli'
|
8
7
|
autoload :Module, 'puppet-magnum/cli/module'
|
9
8
|
|
9
|
+
autoload :Verify, 'puppet-magnum/utility/verify'
|
10
|
+
|
11
|
+
autoload :BaseGenerator, 'puppet-magnum/generators/base_generator'
|
12
|
+
autoload :CreateGenerator, 'puppet-magnum/generators/create_generator'
|
13
|
+
|
10
14
|
def self.root
|
11
15
|
@root ||= Pathname.new(File.expand_path('../', File.dirname(__FILE__)))
|
12
16
|
end
|
17
|
+
|
13
18
|
end
|
@@ -14,6 +14,11 @@ module PuppetMagnum
|
|
14
14
|
PuppetMagnum::CreateGenerator.new([File.join(Dir.pwd, module_name), module_name], options).invoke_all
|
15
15
|
end
|
16
16
|
|
17
|
+
desc 'verify [MODULE_NAME]', 'Verifies the Puppet module.'
|
18
|
+
def verify(module_name)
|
19
|
+
PuppetMagnum::Verify.new([File.join(Dir.pwd, module_name), module_name], options).invoke_all
|
20
|
+
end
|
21
|
+
|
17
22
|
def self.banner(task, namespace = false, subcommand = true)
|
18
23
|
"#{basename} #{task.formatted_usage(self, namespace, subcommand).split(':').join(' ')}"
|
19
24
|
end
|
@@ -20,6 +20,30 @@ module PuppetMagnum
|
|
20
20
|
class_option :copyright_holder,
|
21
21
|
type: :string
|
22
22
|
|
23
|
+
# first, remove ANY unused legacy files and directories.
|
24
|
+
# (migration function from `puppet-magnum` 3.x to 4.x)
|
25
|
+
def write_remove_legacy_files_dirs
|
26
|
+
if File.exist?(target.join('.puppet-magnum.init'))
|
27
|
+
|
28
|
+
legacy_files = ['.fixtures.yml', '.vagrant_puppet', 'Vagrantfile']
|
29
|
+
legacy_files.each do |legacy_file|
|
30
|
+
if File.exist?(target.join("#{legacy_file}"))
|
31
|
+
remove_file target.join("#{legacy_file}")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
legacy_dirs = ['spec', 'serverspec']
|
36
|
+
legacy_dirs.each do |legacy_dir|
|
37
|
+
if File.exist?(target.join("#{legacy_dir}"))
|
38
|
+
directory target.join("#{legacy_dir}"), target.join("#{legacy_dir}.old")
|
39
|
+
remove_file target.join("#{legacy_dir}")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
remove_file target.join('.puppet-magnum.init')
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
23
47
|
def write_dirs
|
24
48
|
dirs = ['manifests', 'data', 'templates', 'files',
|
25
49
|
'spec', 'spec/acceptance', 'spec/acceptance/nodesets', 'spec/acceptance/nodesets/docker',
|
@@ -36,6 +60,16 @@ module PuppetMagnum
|
|
36
60
|
template 'base/CHANGELOG.md.erb', target.join('CHANGELOG.md')
|
37
61
|
end
|
38
62
|
|
63
|
+
def write_util_files
|
64
|
+
remove_file target.join('Gemfile')
|
65
|
+
remove_file target.join('Rakefile')
|
66
|
+
remove_file target.join('.puppet-magnum')
|
67
|
+
|
68
|
+
template 'util/Gemfile.erb', target.join('Gemfile')
|
69
|
+
template 'util/Rakefile.erb', target.join('Rakefile')
|
70
|
+
template 'util/puppet-magnum.erb', target.join('.puppet-magnum')
|
71
|
+
end
|
72
|
+
|
39
73
|
def write_puppet_files
|
40
74
|
template 'puppet/metadata.json.erb', target.join('metadata.json')
|
41
75
|
template 'puppet/init.pp.erb', target.join('manifests/init.pp')
|
@@ -50,7 +84,11 @@ module PuppetMagnum
|
|
50
84
|
# beaker test files
|
51
85
|
template 'spec/acceptance/spec_helper_acceptance.rb.erb', target.join('spec/spec_helper_acceptance.rb')
|
52
86
|
|
53
|
-
beaker_sut_files = [
|
87
|
+
beaker_sut_files = [
|
88
|
+
'ubuntu-server-1404-x64.yml',
|
89
|
+
'ubuntu-server-1604-x64.yml',
|
90
|
+
]
|
91
|
+
|
54
92
|
beaker_sut_files.each do |beaker_sut_file|
|
55
93
|
# VirtualBox
|
56
94
|
template "spec/acceptance/#{beaker_sut_file}.erb", target.join("spec/acceptance/nodesets/#{beaker_sut_file}")
|
@@ -59,17 +97,7 @@ module PuppetMagnum
|
|
59
97
|
end
|
60
98
|
end
|
61
99
|
|
62
|
-
|
63
|
-
remove_file target.join('Gemfile')
|
64
|
-
remove_file target.join('Rakefile')
|
65
|
-
remove_file target.join('.puppet-magnum.init')
|
66
|
-
|
67
|
-
template 'util/Gemfile.erb', target.join('Gemfile')
|
68
|
-
template 'util/Rakefile.erb', target.join('Rakefile')
|
69
|
-
template 'util/puppet-magnum.init.erb', target.join('.puppet-magnum.init')
|
70
|
-
end
|
71
|
-
|
72
|
-
# due to the 'git add' operation, this function should be called last
|
100
|
+
# due to the 'git add' operation, this function should be called last.
|
73
101
|
def write_git_setup
|
74
102
|
remove_file target.join('.gitignore')
|
75
103
|
template 'git/gitignore.erb', target.join('.gitignore')
|
@@ -124,8 +152,12 @@ module PuppetMagnum
|
|
124
152
|
options[:copyright_holder] || maintainer
|
125
153
|
end
|
126
154
|
|
127
|
-
def
|
128
|
-
|
155
|
+
def puppet_magnum_init_date
|
156
|
+
Time.now.ctime
|
157
|
+
end
|
158
|
+
|
159
|
+
def puppet_magnum_init_version
|
160
|
+
PuppetMagnum::VERSION.chomp
|
129
161
|
end
|
130
162
|
|
131
163
|
def default_options
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
module PuppetMagnum
|
4
|
+
class Verify < Thor::Group
|
5
|
+
|
6
|
+
include Thor::Actions
|
7
|
+
include Thor::Shell
|
8
|
+
|
9
|
+
argument :path, type: :string, required: true
|
10
|
+
argument :module_name, type: :string, required: true
|
11
|
+
|
12
|
+
def verify_module
|
13
|
+
# FIXME
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def target
|
19
|
+
@target ||= Pathname.new(File.expand_path(path))
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-magnum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tehmasp Chaudhri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sem_ver
|
@@ -204,12 +204,13 @@ files:
|
|
204
204
|
- generator_files/spec/rspec.erb
|
205
205
|
- generator_files/util/Gemfile.erb
|
206
206
|
- generator_files/util/Rakefile.erb
|
207
|
-
- generator_files/util/puppet-magnum.
|
207
|
+
- generator_files/util/puppet-magnum.erb
|
208
208
|
- lib/puppet-magnum.rb
|
209
209
|
- lib/puppet-magnum/cli.rb
|
210
210
|
- lib/puppet-magnum/cli/module.rb
|
211
211
|
- lib/puppet-magnum/generators/base_generator.rb
|
212
212
|
- lib/puppet-magnum/generators/create_generator.rb
|
213
|
+
- lib/puppet-magnum/utility/verify.rb
|
213
214
|
- lib/puppet-magnum/version.rb
|
214
215
|
- puppet-magnum.gemspec
|
215
216
|
- spec/lib/puppet-magnum/cli_spec.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= puppet_magnum_init_timestamp %>
|