knife-changelog 0.0.1
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 +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +9 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +181 -0
- data/LICENSE.txt +22 -0
- data/README.md +21 -0
- data/Rakefile +7 -0
- data/knife-changelog.gemspec +30 -0
- data/lib/chef/knife/changelog.rb +164 -0
- data/lib/knife/changelog/version.rb +5 -0
- data/resources/Berksfile +4 -0
- data/resources/Berksfile.lock +9 -0
- metadata +140 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: a7bea4f6a0e0d4c2a2904c625fd38a6a19899510
|
|
4
|
+
data.tar.gz: 1a9133fcbbe9dfcb63df3211a866b2e14460920d
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 221fd8ae1f49fc3c9125ce7752108a42334f9ec4ba9b7b1078f8157408cb435d0b08ad8d2ceb83712cb3298be60ce20df6b5b27d84bc28187eb2293f5c17088c
|
|
7
|
+
data.tar.gz: 61b5dc799fd99c8c141fb7634b036d606fd9c99455ae10d91589d723530765124bebf1aad67b1ce1c7e7db2cf1179d13924b3fb1de04415c0c3b4b1277fc31e2
|
data/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bundle/
|
data/.travis.yml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
language: ruby
|
|
2
|
+
deploy:
|
|
3
|
+
provider: rubygems
|
|
4
|
+
api_key:
|
|
5
|
+
secure: LAM8qxTQa6oxzKiQpWrqRlcE1czmGFj16NSj1FVgZYJLZIfXKdvSpth+DfuCk8mxG1tvDXa3ckfERrzexG3lYGNPGyZH2sjnyt900Evd3Bn8vhv0LXE7cEZb3x/uJ3RHRvKpEDnMsy4gqoVByDLWXWnI9Q/8B4AtzFeTVsTr48g=
|
|
6
|
+
gem: knife-changelog
|
|
7
|
+
on:
|
|
8
|
+
tags: true
|
|
9
|
+
repo: kamaradclimber/knife-changelog
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
knife-changelog (0.0.1)
|
|
5
|
+
berkshelf
|
|
6
|
+
chef (~> 11.16)
|
|
7
|
+
mixlib-shellout
|
|
8
|
+
|
|
9
|
+
GEM
|
|
10
|
+
remote: https://rubygems.org/
|
|
11
|
+
specs:
|
|
12
|
+
addressable (2.3.6)
|
|
13
|
+
berkshelf (3.2.1)
|
|
14
|
+
addressable (~> 2.3.4)
|
|
15
|
+
berkshelf-api-client (~> 1.2)
|
|
16
|
+
buff-config (~> 1.0)
|
|
17
|
+
buff-extensions (~> 1.0)
|
|
18
|
+
buff-shell_out (~> 0.1)
|
|
19
|
+
celluloid (~> 0.16.0)
|
|
20
|
+
celluloid-io (~> 0.16.1)
|
|
21
|
+
cleanroom (~> 1.0)
|
|
22
|
+
faraday (~> 0.9.0)
|
|
23
|
+
minitar (~> 0.5.4)
|
|
24
|
+
octokit (~> 3.0)
|
|
25
|
+
retryable (~> 1.3.3)
|
|
26
|
+
ridley (~> 4.0)
|
|
27
|
+
solve (~> 1.1)
|
|
28
|
+
thor (~> 0.19)
|
|
29
|
+
berkshelf-api-client (1.2.0)
|
|
30
|
+
faraday (~> 0.9.0)
|
|
31
|
+
buff-config (1.0.1)
|
|
32
|
+
buff-extensions (~> 1.0)
|
|
33
|
+
varia_model (~> 0.4)
|
|
34
|
+
buff-extensions (1.0.0)
|
|
35
|
+
buff-ignore (1.1.1)
|
|
36
|
+
buff-ruby_engine (0.1.0)
|
|
37
|
+
buff-shell_out (0.2.0)
|
|
38
|
+
buff-ruby_engine (~> 0.1.0)
|
|
39
|
+
celluloid (0.16.0)
|
|
40
|
+
timers (~> 4.0.0)
|
|
41
|
+
celluloid-io (0.16.1)
|
|
42
|
+
celluloid (>= 0.16.0)
|
|
43
|
+
nio4r (>= 1.0.0)
|
|
44
|
+
chef (11.16.4)
|
|
45
|
+
chef-zero (~> 2.1, >= 2.1.4)
|
|
46
|
+
diff-lcs (~> 1.2, >= 1.2.4)
|
|
47
|
+
erubis (~> 2.7)
|
|
48
|
+
ffi-yajl (~> 1.0)
|
|
49
|
+
highline (~> 1.6, >= 1.6.9)
|
|
50
|
+
mime-types (~> 1.16)
|
|
51
|
+
mixlib-authentication (~> 1.3)
|
|
52
|
+
mixlib-cli (~> 1.4)
|
|
53
|
+
mixlib-config (~> 2.0)
|
|
54
|
+
mixlib-log (~> 1.3)
|
|
55
|
+
mixlib-shellout (~> 1.4)
|
|
56
|
+
net-ssh (~> 2.6)
|
|
57
|
+
net-ssh-multi (~> 1.1)
|
|
58
|
+
ohai (~> 7.4)
|
|
59
|
+
plist (~> 3.1.0)
|
|
60
|
+
pry (~> 0.9)
|
|
61
|
+
rest-client (>= 1.0.4, <= 1.6.7)
|
|
62
|
+
chef-zero (2.2.1)
|
|
63
|
+
ffi-yajl (~> 1.1)
|
|
64
|
+
hashie (~> 2.0)
|
|
65
|
+
mixlib-log (~> 1.3)
|
|
66
|
+
rack
|
|
67
|
+
cleanroom (1.0.0)
|
|
68
|
+
coderay (1.1.0)
|
|
69
|
+
dep-selector-libgecode (1.0.2)
|
|
70
|
+
dep_selector (1.0.3)
|
|
71
|
+
dep-selector-libgecode (~> 1.0)
|
|
72
|
+
ffi (~> 1.9)
|
|
73
|
+
diff-lcs (1.2.5)
|
|
74
|
+
erubis (2.7.0)
|
|
75
|
+
faraday (0.9.0)
|
|
76
|
+
multipart-post (>= 1.2, < 3)
|
|
77
|
+
ffi (1.9.6)
|
|
78
|
+
ffi-yajl (1.3.1)
|
|
79
|
+
ffi (~> 1.5)
|
|
80
|
+
libyajl2 (~> 1.2)
|
|
81
|
+
hashie (2.1.2)
|
|
82
|
+
highline (1.6.21)
|
|
83
|
+
hitimes (1.2.2)
|
|
84
|
+
ipaddress (0.8.0)
|
|
85
|
+
json (1.8.1)
|
|
86
|
+
libyajl2 (1.2.0)
|
|
87
|
+
method_source (0.8.2)
|
|
88
|
+
mime-types (1.25.1)
|
|
89
|
+
minitar (0.5.4)
|
|
90
|
+
mixlib-authentication (1.3.0)
|
|
91
|
+
mixlib-log
|
|
92
|
+
mixlib-cli (1.5.0)
|
|
93
|
+
mixlib-config (2.1.0)
|
|
94
|
+
mixlib-log (1.6.0)
|
|
95
|
+
mixlib-shellout (1.6.1)
|
|
96
|
+
multipart-post (2.0.0)
|
|
97
|
+
net-http-persistent (2.9.4)
|
|
98
|
+
net-ssh (2.9.1)
|
|
99
|
+
net-ssh-gateway (1.2.0)
|
|
100
|
+
net-ssh (>= 2.6.5)
|
|
101
|
+
net-ssh-multi (1.2.0)
|
|
102
|
+
net-ssh (>= 2.6.5)
|
|
103
|
+
net-ssh-gateway (>= 1.2.0)
|
|
104
|
+
nio4r (1.0.1)
|
|
105
|
+
octokit (3.7.0)
|
|
106
|
+
sawyer (~> 0.6.0, >= 0.5.3)
|
|
107
|
+
ohai (7.4.0)
|
|
108
|
+
ffi (~> 1.9)
|
|
109
|
+
ffi-yajl (~> 1.0)
|
|
110
|
+
ipaddress
|
|
111
|
+
mime-types (~> 1.16)
|
|
112
|
+
mixlib-cli
|
|
113
|
+
mixlib-config (~> 2.0)
|
|
114
|
+
mixlib-log
|
|
115
|
+
mixlib-shellout (~> 1.2)
|
|
116
|
+
systemu (~> 2.6.4)
|
|
117
|
+
wmi-lite (~> 1.0)
|
|
118
|
+
plist (3.1.0)
|
|
119
|
+
pry (0.10.1)
|
|
120
|
+
coderay (~> 1.1.0)
|
|
121
|
+
method_source (~> 0.8.1)
|
|
122
|
+
slop (~> 3.4)
|
|
123
|
+
rack (1.5.2)
|
|
124
|
+
rake (10.4.2)
|
|
125
|
+
rest-client (1.6.7)
|
|
126
|
+
mime-types (>= 1.16)
|
|
127
|
+
retryable (1.3.6)
|
|
128
|
+
ridley (4.1.1)
|
|
129
|
+
addressable
|
|
130
|
+
buff-config (~> 1.0)
|
|
131
|
+
buff-extensions (~> 1.0)
|
|
132
|
+
buff-ignore (~> 1.1)
|
|
133
|
+
buff-shell_out (~> 0.1)
|
|
134
|
+
celluloid (~> 0.16.0)
|
|
135
|
+
celluloid-io (~> 0.16.1)
|
|
136
|
+
erubis
|
|
137
|
+
faraday (~> 0.9.0)
|
|
138
|
+
hashie (>= 2.0.2, < 3.0.0)
|
|
139
|
+
json (>= 1.7.7)
|
|
140
|
+
mixlib-authentication (>= 1.3.0)
|
|
141
|
+
net-http-persistent (>= 2.8)
|
|
142
|
+
retryable
|
|
143
|
+
semverse (~> 1.1)
|
|
144
|
+
varia_model (~> 0.4)
|
|
145
|
+
rspec (3.1.0)
|
|
146
|
+
rspec-core (~> 3.1.0)
|
|
147
|
+
rspec-expectations (~> 3.1.0)
|
|
148
|
+
rspec-mocks (~> 3.1.0)
|
|
149
|
+
rspec-core (3.1.7)
|
|
150
|
+
rspec-support (~> 3.1.0)
|
|
151
|
+
rspec-expectations (3.1.2)
|
|
152
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
153
|
+
rspec-support (~> 3.1.0)
|
|
154
|
+
rspec-mocks (3.1.3)
|
|
155
|
+
rspec-support (~> 3.1.0)
|
|
156
|
+
rspec-support (3.1.2)
|
|
157
|
+
sawyer (0.6.0)
|
|
158
|
+
addressable (~> 2.3.5)
|
|
159
|
+
faraday (~> 0.8, < 0.10)
|
|
160
|
+
semverse (1.2.1)
|
|
161
|
+
slop (3.6.0)
|
|
162
|
+
solve (1.2.1)
|
|
163
|
+
dep_selector (~> 1.0)
|
|
164
|
+
semverse (~> 1.1)
|
|
165
|
+
systemu (2.6.4)
|
|
166
|
+
thor (0.19.1)
|
|
167
|
+
timers (4.0.1)
|
|
168
|
+
hitimes
|
|
169
|
+
varia_model (0.4.0)
|
|
170
|
+
buff-extensions (~> 1.0)
|
|
171
|
+
hashie (>= 2.0.2, < 3.0.0)
|
|
172
|
+
wmi-lite (1.0.0)
|
|
173
|
+
|
|
174
|
+
PLATFORMS
|
|
175
|
+
ruby
|
|
176
|
+
|
|
177
|
+
DEPENDENCIES
|
|
178
|
+
bundler (~> 1.6)
|
|
179
|
+
knife-changelog!
|
|
180
|
+
rake
|
|
181
|
+
rspec
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2014 Gregoire Seux
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Knife::Changelog
|
|
2
|
+
|
|
3
|
+
knife-changelog aims to make find cookbook changelogs easily to help upgrades.
|
|
4
|
+
|
|
5
|
+
Using it will create changelogs from your current version to most up-to-date version.
|
|
6
|
+
|
|
7
|
+
Usage : `knife changelog COOKBOOK [COKKBOOK...]`
|
|
8
|
+
|
|
9
|
+
Options:
|
|
10
|
+
- `--linkify` or `-l` outputs markdown with links to commits
|
|
11
|
+
- `--ignore-changelog-file` allow to force the usage of raw git history instead of Changelog file
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- generate changelogs for some supermarket hosted cookbooks
|
|
16
|
+
- generate changelogs for all git located cookbooks
|
|
17
|
+
|
|
18
|
+
## Todos
|
|
19
|
+
|
|
20
|
+
- (optionaly) link commit ref to their web page to ease reviews
|
|
21
|
+
- support more cookbook sources
|
data/Rakefile
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'knife/changelog/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "knife-changelog"
|
|
8
|
+
spec.version = Knife::Changelog::VERSION
|
|
9
|
+
spec.version = "#{spec.version}-alpha-#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
|
|
10
|
+
spec.authors = ["Gregoire Seux"]
|
|
11
|
+
spec.email = ["kamaradclimber@gmail.com"]
|
|
12
|
+
spec.summary = %q{Facilitate access to cookbooks changelog}
|
|
13
|
+
spec.description = %q{}
|
|
14
|
+
spec.homepage = ""
|
|
15
|
+
spec.license = "MIT"
|
|
16
|
+
|
|
17
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
20
|
+
spec.require_paths = ["lib"]
|
|
21
|
+
|
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
|
23
|
+
spec.add_development_dependency "rake"
|
|
24
|
+
spec.add_development_dependency "rspec"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
spec.add_dependency 'berkshelf'
|
|
28
|
+
spec.add_dependency 'mixlib-shellout'
|
|
29
|
+
spec.add_dependency 'chef', '~> 11.16'
|
|
30
|
+
end
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
require "knife/changelog/version"
|
|
2
|
+
require "berkshelf"
|
|
3
|
+
require 'chef/knife'
|
|
4
|
+
require 'mixlib/shellout'
|
|
5
|
+
|
|
6
|
+
class Chef
|
|
7
|
+
class Knife
|
|
8
|
+
class Changelog < Knife
|
|
9
|
+
|
|
10
|
+
banner 'knife changelog COOKBOOK [COOKBOOK ...]'
|
|
11
|
+
|
|
12
|
+
def initialize(options)
|
|
13
|
+
super
|
|
14
|
+
@tmp_prefix = 'knife-changelog'
|
|
15
|
+
@berksfile = Berkshelf::Berksfile.from_options({})
|
|
16
|
+
@tmp_dirs = []
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
option :linkify,
|
|
20
|
+
:short => '-l',
|
|
21
|
+
:long => '--linkify',
|
|
22
|
+
:description => 'add markdown links where relevant',
|
|
23
|
+
:boolean => true
|
|
24
|
+
|
|
25
|
+
option :ignore_changelog_file,
|
|
26
|
+
:long => '--ignore-changelog-file',
|
|
27
|
+
:description => "Ignore changelog file presence, use git history instead",
|
|
28
|
+
:boolean => true
|
|
29
|
+
|
|
30
|
+
def run
|
|
31
|
+
begin
|
|
32
|
+
if @name_args.empty?
|
|
33
|
+
cks = @berksfile.cookbooks.collect {|c| c.name }
|
|
34
|
+
else
|
|
35
|
+
cks = @name_args
|
|
36
|
+
end
|
|
37
|
+
cks.each do |cookbook|
|
|
38
|
+
execute cookbook
|
|
39
|
+
end
|
|
40
|
+
ensure
|
|
41
|
+
clean
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def clean
|
|
46
|
+
@tmp_dirs.each do |dir|
|
|
47
|
+
FileUtils.rm_r dir
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def ck_dep(name)
|
|
52
|
+
@berksfile.lockfile.find(name)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def ck_location(name)
|
|
56
|
+
ck_dep(name).location
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def version_for(name)
|
|
60
|
+
# FIXME uses public methods instead
|
|
61
|
+
@berksfile.lockfile.graph.instance_variable_get(:@graph)[name].version
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def execute(name)
|
|
65
|
+
loc = ck_location(name)
|
|
66
|
+
changelog = case loc
|
|
67
|
+
when NilClass
|
|
68
|
+
handle_source name, ck_dep(name)
|
|
69
|
+
when Berkshelf::GitLocation
|
|
70
|
+
handle_git loc
|
|
71
|
+
else
|
|
72
|
+
raise "Cannot handle #{loc.class} yet"
|
|
73
|
+
end
|
|
74
|
+
print_changelog(name, changelog)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def print_changelog(name, changelog)
|
|
78
|
+
unless changelog.empty?
|
|
79
|
+
puts "--- Changelog for #{name} ---"
|
|
80
|
+
puts changelog
|
|
81
|
+
puts "-----------------"
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def handle_source(name, dep)
|
|
86
|
+
ck = noauth_rest.get_rest("https://supermarket.getchef.com/api/v1/cookbooks/#{name}")
|
|
87
|
+
url = ck['source_url'] || ck ['external_url']
|
|
88
|
+
case url
|
|
89
|
+
when nil
|
|
90
|
+
fail "No external url for #{name}, can't find any changelog source"
|
|
91
|
+
when /github.com\/(.*)(.git)?/
|
|
92
|
+
options = {
|
|
93
|
+
:github => $1,
|
|
94
|
+
:revision => 'v' + version_for(name),
|
|
95
|
+
}
|
|
96
|
+
location = Berkshelf::GithubLocation.new dep, options
|
|
97
|
+
handle_git(location)
|
|
98
|
+
else
|
|
99
|
+
fail "External url #{url} points to unusable location!"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def handle_git(location)
|
|
104
|
+
tmp_dir = shallow_clone(@tmp_prefix,location.uri)
|
|
105
|
+
|
|
106
|
+
rev_parse = location.instance_variable_get(:@rev_parse)
|
|
107
|
+
cur_rev = location.revision.rstrip
|
|
108
|
+
ls_tree = Mixlib::ShellOut.new("git ls-tree -r #{rev_parse}", :cwd => tmp_dir)
|
|
109
|
+
ls_tree.run_command
|
|
110
|
+
changelog = ls_tree.stdout.lines.find { |line| line =~ /\s(changelog.*$)/i }
|
|
111
|
+
if changelog and not config[:ignore_changelog_file]
|
|
112
|
+
puts "Found changelog file : " + $1
|
|
113
|
+
generate_from_changelog_file($1, cur_rev, rev_parse, tmp_dir)
|
|
114
|
+
else
|
|
115
|
+
generate_from_git_history(tmp_dir, location, cur_rev, rev_parse)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def generate_from_changelog_file(filename, current_rev, rev_parse, tmp_dir)
|
|
120
|
+
diff = Mixlib::ShellOut.new("git diff #{current_rev}..#{rev_parse} -- #{filename}", :cwd => tmp_dir)
|
|
121
|
+
diff.run_command
|
|
122
|
+
diff.stdout.lines.collect {|line| $1 if line =~ /^\+([^+].*)/}.compact
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def generate_from_git_history(tmp_dir, location, current_rev, rev_parse)
|
|
126
|
+
log = Mixlib::ShellOut.new("git log --no-merges --abbrev-commit --pretty=oneline #{current_rev}..#{rev_parse}", :cwd => tmp_dir)
|
|
127
|
+
log.run_command
|
|
128
|
+
c = log.stdout
|
|
129
|
+
n = https_url(location)
|
|
130
|
+
c = linkify(n, c) if config[:linkify] and n
|
|
131
|
+
c
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def linkify(url, changelog)
|
|
135
|
+
changelog = changelog.lines.map { |line|
|
|
136
|
+
line.gsub(/^([a-f0-9]+) /, '[%s/commit/\1](\1) ' % [url])
|
|
137
|
+
}
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def https_url(location)
|
|
141
|
+
if location.uri =~ /^\w+:\/\/(.*@)?(.*)(\.git?)/
|
|
142
|
+
"https://%s" % [ $2 ]
|
|
143
|
+
else
|
|
144
|
+
fail "Cannot guess http url from git remote url"
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def short(location)
|
|
149
|
+
if location.uri =~ /([\w-]+)\/([\w-]+)(\.git)?$/
|
|
150
|
+
"%s/%s" % [$1,$2]
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def shallow_clone(tmp_prefix, uri)
|
|
155
|
+
dir = Dir.mktmpdir(tmp_prefix)
|
|
156
|
+
@tmp_dirs << dir
|
|
157
|
+
clone = Mixlib::ShellOut.new("git clone --bare #{uri} bare-clone", :cwd => dir)
|
|
158
|
+
clone.run_command
|
|
159
|
+
::File.join(dir, 'bare-clone')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
end
|
data/resources/Berksfile
ADDED
metadata
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: knife-changelog
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Gregoire Seux
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2014-12-15 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.6'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.6'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rspec
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: berkshelf
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: mixlib-shellout
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: chef
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '11.16'
|
|
90
|
+
type: :runtime
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '11.16'
|
|
97
|
+
description: ''
|
|
98
|
+
email:
|
|
99
|
+
- kamaradclimber@gmail.com
|
|
100
|
+
executables: []
|
|
101
|
+
extensions: []
|
|
102
|
+
extra_rdoc_files: []
|
|
103
|
+
files:
|
|
104
|
+
- ".gitignore"
|
|
105
|
+
- ".travis.yml"
|
|
106
|
+
- Gemfile
|
|
107
|
+
- Gemfile.lock
|
|
108
|
+
- LICENSE.txt
|
|
109
|
+
- README.md
|
|
110
|
+
- Rakefile
|
|
111
|
+
- knife-changelog.gemspec
|
|
112
|
+
- lib/chef/knife/changelog.rb
|
|
113
|
+
- lib/knife/changelog/version.rb
|
|
114
|
+
- resources/Berksfile
|
|
115
|
+
- resources/Berksfile.lock
|
|
116
|
+
homepage: ''
|
|
117
|
+
licenses:
|
|
118
|
+
- MIT
|
|
119
|
+
metadata: {}
|
|
120
|
+
post_install_message:
|
|
121
|
+
rdoc_options: []
|
|
122
|
+
require_paths:
|
|
123
|
+
- lib
|
|
124
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
|
+
requirements:
|
|
126
|
+
- - ">="
|
|
127
|
+
- !ruby/object:Gem::Version
|
|
128
|
+
version: '0'
|
|
129
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
|
+
requirements:
|
|
131
|
+
- - ">="
|
|
132
|
+
- !ruby/object:Gem::Version
|
|
133
|
+
version: '0'
|
|
134
|
+
requirements: []
|
|
135
|
+
rubyforge_project:
|
|
136
|
+
rubygems_version: 2.2.2
|
|
137
|
+
signing_key:
|
|
138
|
+
specification_version: 4
|
|
139
|
+
summary: Facilitate access to cookbooks changelog
|
|
140
|
+
test_files: []
|