knife-changelog 0.0.7 → 0.0.8.pre.alpha.pre.16
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 +13 -5
- data/lib/chef/knife/changelog.rb +39 -12
- data/lib/knife/changelog/version.rb +1 -1
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OGYyMjhiNTY1YWQ4OGNmZTg4NzQ4ZTA1YzFjOTg0ZDVjYWVmYjRmYw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NDEyYjdjZWNkZmUyMTliMWFhYzQ2NjU5YTRhNDhiNDZhMjEwMDUzMQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NWY1NzBmNjM3ODRkYjFkNzJhZWUxZDEyZDBiMzYxN2IzYzg3ZGJjYjZhN2Ux
|
10
|
+
MjM3ZDgzNjAwNjg3MTBhMGIwMzQyZjJhYzdhNjY5NTU3ZGE5Y2FkOTEyNGQy
|
11
|
+
Nzc4ZmYxNThkNTFmMTE3MTU4ZmUyOTE4ZDAyNGJiZWMwNDI3MzQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
M2U3NTJmZDUyZmE2ZDg4ZjJlNzg1MjgwODc5MWQxOWY1YjI1MWRlOTBmZmE1
|
14
|
+
ZWFjOTI1NTQ4YzE2NGQ2YjQ4ODg2MGNlNWIwZWNlZWY2Y2QwOGRkODg3NDU3
|
15
|
+
YWFlM2EzMTFjMDhjN2M1ZDM0YTk4MDJhMjBkYTkxYWE1ODAyODk=
|
data/lib/chef/knife/changelog.rb
CHANGED
@@ -33,17 +33,27 @@ class Chef
|
|
33
33
|
:description => "Ignore changelog file presence, use git history instead",
|
34
34
|
:boolean => true
|
35
35
|
|
36
|
+
option :submodules,
|
37
|
+
:long => '--submodules SUBMODULE[,SUBMODULE]',
|
38
|
+
:description => 'Submoduless to check for changes as well (comma separated)'
|
39
|
+
|
40
|
+
|
36
41
|
def run
|
37
42
|
begin
|
43
|
+
Log.info config
|
38
44
|
if @name_args.empty?
|
39
45
|
cks = @berksfile.cookbooks.collect {|c| c.cookbook_name }
|
40
46
|
else
|
41
47
|
cks = @name_args
|
42
48
|
end
|
43
49
|
cks.each do |cookbook|
|
44
|
-
Log.debug "Checking changelog for #{cookbook}"
|
50
|
+
Log.debug "Checking changelog for #{cookbook} (cookbook)"
|
45
51
|
execute cookbook
|
46
52
|
end
|
53
|
+
(config[:submodules] || '').split(',').each do |submodule|
|
54
|
+
Log.debug "Checking changelog for #{submodule} (submodule)"
|
55
|
+
execute(submodule, true)
|
56
|
+
end
|
47
57
|
ensure
|
48
58
|
clean
|
49
59
|
end
|
@@ -68,18 +78,22 @@ class Chef
|
|
68
78
|
@berksfile.lockfile.graph.instance_variable_get(:@graph)[name].version
|
69
79
|
end
|
70
80
|
|
71
|
-
def execute(name)
|
72
|
-
|
73
|
-
|
74
|
-
when NilClass
|
75
|
-
handle_source name, ck_dep(name)
|
76
|
-
when Berkshelf::GitLocation
|
77
|
-
handle_git loc
|
78
|
-
when Berkshelf::PathLocation
|
79
|
-
Log.debug "path location are always at the last version"
|
80
|
-
""
|
81
|
+
def execute(name, submodule=false)
|
82
|
+
changelog = if submodule
|
83
|
+
handle_submodule(name)
|
81
84
|
else
|
82
|
-
|
85
|
+
loc = ck_location(name)
|
86
|
+
case loc
|
87
|
+
when NilClass
|
88
|
+
handle_source name, ck_dep(name)
|
89
|
+
when Berkshelf::GitLocation
|
90
|
+
handle_git loc
|
91
|
+
when Berkshelf::PathLocation
|
92
|
+
Log.debug "path location are always at the last version"
|
93
|
+
""
|
94
|
+
else
|
95
|
+
raise "Cannot handle #{loc.class} yet"
|
96
|
+
end
|
83
97
|
end
|
84
98
|
print_changelog(name, changelog)
|
85
99
|
end
|
@@ -127,6 +141,19 @@ class Chef
|
|
127
141
|
rev
|
128
142
|
end
|
129
143
|
|
144
|
+
def handle_submodule(name)
|
145
|
+
subm_url = Mixlib::ShellOut.new("git config --list| grep ^submodule | grep ^submodule.#{name}.url")
|
146
|
+
subm_url.run_command
|
147
|
+
subm_url.error!
|
148
|
+
url = subm_url.stdout.lines.first.split('=')[1].chomp
|
149
|
+
subm_revision = Mixlib::ShellOut.new("git submodule status #{name}")
|
150
|
+
subm_revision.run_command
|
151
|
+
subm_revision.error!
|
152
|
+
revision = subm_revision.stdout.strip.split(' ').first
|
153
|
+
loc = Berkshelf::Location.init(nil, {git: url,revision: revision})
|
154
|
+
handle_git(loc)
|
155
|
+
end
|
156
|
+
|
130
157
|
def handle_git(location)
|
131
158
|
tmp_dir = shallow_clone(@tmp_prefix,location.uri)
|
132
159
|
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-changelog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8.pre.alpha.pre.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregoire Seux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: berkshelf
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ! '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mixlib-shellout
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: chef
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '11.16'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '11.16'
|
97
97
|
description: ''
|
@@ -101,8 +101,8 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
-
|
105
|
-
-
|
104
|
+
- .gitignore
|
105
|
+
- .travis.yml
|
106
106
|
- Gemfile
|
107
107
|
- LICENSE.txt
|
108
108
|
- README.md
|
@@ -122,17 +122,17 @@ require_paths:
|
|
122
122
|
- lib
|
123
123
|
required_ruby_version: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
|
-
- -
|
125
|
+
- - ! '>='
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- -
|
130
|
+
- - ! '>'
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
132
|
+
version: 1.3.1
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.
|
135
|
+
rubygems_version: 2.4.5
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Facilitate access to cookbooks changelog
|