stove 3.2.6 → 3.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +5 -0
- data/CHANGELOG.md +10 -0
- data/README.md +8 -2
- data/lib/stove/cli.rb +8 -3
- data/lib/stove/community.rb +4 -4
- data/lib/stove/cookbook.rb +2 -2
- data/lib/stove/cookbook/metadata.rb +11 -7
- data/lib/stove/packager.rb +13 -5
- data/lib/stove/plugins/community.rb +1 -1
- data/lib/stove/version.rb +1 -1
- data/spec/support/generators.rb +1 -1
- data/spec/unit/cookbook/metadata_spec.rb +23 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e408d2205fca9b0b14a446ae29746f36b39b9411
|
4
|
+
data.tar.gz: 4c3f9baa7f8de64aa63b484264db3aed57cdf7b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 108c86f18357afa93cdcb735f8dbc2a8fa688a4d2fe44aff21132469862e667b424eb4a7586b89d22d47602853d52b9ebbf616743e4e116df0e75ce8a58a3a3b
|
7
|
+
data.tar.gz: db000dddde6faf57a6073c23d3322c6c800565bbab6a60ac4166c13b56453fb95a708096f50992a34734b66e3a11be3a355ce4da2878a8ecd51413c54d0981c9
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,16 @@ Stove CHANGELOG
|
|
2
2
|
===============
|
3
3
|
This is the Changelog for the Stove gem.
|
4
4
|
|
5
|
+
v3.2.7 (2015-04-16)
|
6
|
+
-------------------
|
7
|
+
- Use chef.io instead of getchef.com
|
8
|
+
- Ignore `vendor/` directory
|
9
|
+
- Do not publish extended metadata fields like `issues_url` and `source_url` by
|
10
|
+
default (GH-64, GH-72). These fields can be optionally added using the
|
11
|
+
new `--extended-metadata` flag.
|
12
|
+
- Add support for Ruby 2.2
|
13
|
+
- Use binmode when reading and writing the tgz (GH-64)
|
14
|
+
|
5
15
|
v3.2.6 (2015-03-18)
|
6
16
|
-------------------
|
7
17
|
- Include new metadata methods for Supermarket
|
data/README.md
CHANGED
@@ -38,18 +38,24 @@ $ stove login --username sethvargo --key ~/.chef/sethvargo.pem
|
|
38
38
|
|
39
39
|
These values will be saved in Stove's configuration file (`~/.stove`) and persisted across your workstation.
|
40
40
|
|
41
|
-
The default publishing endpoint is the [Chef Supermarket](https://supermarket.
|
41
|
+
The default publishing endpoint is the [Chef Supermarket](https://supermarket.chef.io), but this is configurable. If you want to publish to an internal community site, you can specify the `--endpoint` value:
|
42
42
|
|
43
43
|
```bash
|
44
44
|
$ stove --endpoint https://internal-cookbook-store.example.com
|
45
45
|
```
|
46
46
|
|
47
|
-
or for a private supermarket using the [supermarket](https://supermarket.
|
47
|
+
or for a private supermarket using the [supermarket](https://supermarket.chef.io/cookbooks/supermarket) cookbook:
|
48
48
|
|
49
49
|
```bash
|
50
50
|
$ stove --endpoint https://internal-cookbook-store.example.com/api/v1
|
51
51
|
```
|
52
52
|
|
53
|
+
Please note: depending on which version of Chef and which version of Supermarket you are running, you may support the new "extended" metadata fields. By default, Stove reads but does not write these new fields when uploading cookbooks because it is not backwards compatible. If you are running Chef 12+ and have the latest version of Supermarket installed, you can specify the `--extended-metadata` flag to include these values in the generated metadata:
|
54
|
+
|
55
|
+
```bash
|
56
|
+
$ stove --extended-metadata
|
57
|
+
```
|
58
|
+
|
53
59
|
Usage
|
54
60
|
-----
|
55
61
|
There are two ways to use Stove. You can either use the `stove` command directly or use the embedded rake task.
|
data/lib/stove/cli.rb
CHANGED
@@ -116,6 +116,10 @@ module Stove
|
|
116
116
|
options[:key] = v
|
117
117
|
end
|
118
118
|
|
119
|
+
opts.on('--extended-metadata', 'Include non-backwards compatible metadata keys such as `issues_url`') do
|
120
|
+
options[:extended_metadata] = true
|
121
|
+
end
|
122
|
+
|
119
123
|
opts.separator ''
|
120
124
|
opts.separator 'Git Options:'
|
121
125
|
|
@@ -161,9 +165,10 @@ module Stove
|
|
161
165
|
def options
|
162
166
|
@options ||= {
|
163
167
|
# Upload options
|
164
|
-
:endpoint
|
165
|
-
:username
|
166
|
-
:key
|
168
|
+
:endpoint => nil,
|
169
|
+
:username => Config.username,
|
170
|
+
:key => Config.key,
|
171
|
+
:extended_metadata => false,
|
167
172
|
|
168
173
|
# Git options
|
169
174
|
:remote => 'origin',
|
data/lib/stove/community.rb
CHANGED
@@ -10,7 +10,7 @@ module Stove
|
|
10
10
|
#
|
11
11
|
# @return [String]
|
12
12
|
#
|
13
|
-
DEFAULT_ENDPOINT = 'https://supermarket.
|
13
|
+
DEFAULT_ENDPOINT = 'https://supermarket.chef.io/api/v1'
|
14
14
|
|
15
15
|
#
|
16
16
|
# Get and cache a community cookbook's JSON response from the given name
|
@@ -50,15 +50,15 @@ module Stove
|
|
50
50
|
# @param [Cookbook] cookbook
|
51
51
|
# the cookbook to upload
|
52
52
|
#
|
53
|
-
def upload(cookbook)
|
53
|
+
def upload(cookbook, extended_metadata = false)
|
54
54
|
connection.post('cookbooks', {
|
55
|
-
'tarball' => cookbook.tarball,
|
55
|
+
'tarball' => cookbook.tarball(extended_metadata),
|
56
56
|
|
57
57
|
# This is for legacy, backwards-compatability reasons. The new
|
58
58
|
# Supermarket site does not require a category, but many of the testing
|
59
59
|
# tools still assume a cookbook category is present. We just hardcode
|
60
60
|
# "Other" here.
|
61
|
-
'cookbook' =>
|
61
|
+
'cookbook' => JSON.fast_generate(category: 'Other'),
|
62
62
|
})
|
63
63
|
end
|
64
64
|
|
data/lib/stove/cookbook.rb
CHANGED
@@ -72,6 +72,9 @@ module Stove
|
|
72
72
|
def_attribute :description
|
73
73
|
def_attribute :long_description
|
74
74
|
|
75
|
+
# These attributes are available for reading, but are not written by
|
76
|
+
# default. In order to maintain backwards and forwards compatability,
|
77
|
+
# these attributes are here.
|
75
78
|
def_attribute :source_url
|
76
79
|
def_attribute :issues_url
|
77
80
|
|
@@ -158,14 +161,12 @@ module Stove
|
|
158
161
|
end
|
159
162
|
end
|
160
163
|
|
161
|
-
def to_hash
|
162
|
-
{
|
164
|
+
def to_hash(extended_metadata = false)
|
165
|
+
hash = {
|
163
166
|
'name' => self.name,
|
164
167
|
'version' => self.version,
|
165
168
|
'description' => self.description,
|
166
169
|
'long_description' => self.long_description,
|
167
|
-
'source_url' => self.source_url,
|
168
|
-
'issues_url' => self.issues_url,
|
169
170
|
'maintainer' => self.maintainer,
|
170
171
|
'maintainer_email' => self.maintainer_email,
|
171
172
|
'license' => self.license,
|
@@ -180,10 +181,13 @@ module Stove
|
|
180
181
|
'groupings' => self.groupings,
|
181
182
|
'recipes' => self.recipes,
|
182
183
|
}
|
183
|
-
end
|
184
184
|
|
185
|
-
|
186
|
-
|
185
|
+
if extended_metadata
|
186
|
+
hash['source_url'] = self.source_url
|
187
|
+
hash['issues_url'] = self.issues_url
|
188
|
+
end
|
189
|
+
|
190
|
+
return hash
|
187
191
|
end
|
188
192
|
|
189
193
|
private
|
data/lib/stove/packager.rb
CHANGED
@@ -33,12 +33,20 @@ module Stove
|
|
33
33
|
# @erturn [Stove::Cookbook]
|
34
34
|
attr_reader :cookbook
|
35
35
|
|
36
|
+
# Whether to include the new extended metadata attributes.
|
37
|
+
#
|
38
|
+
# @return [true, false]
|
39
|
+
attr_reader :extended_metadata
|
40
|
+
|
36
41
|
# Create a new packager instance.
|
37
42
|
#
|
38
43
|
# @param [Stove::Cookbook]
|
39
44
|
# the cookbook to package
|
40
|
-
|
45
|
+
# @param [true, false] extended_metadata
|
46
|
+
# include new extended metadata attributes
|
47
|
+
def initialize(cookbook, extended_metadata = false)
|
41
48
|
@cookbook = cookbook
|
49
|
+
@extended_metadata = extended_metadata
|
42
50
|
end
|
43
51
|
|
44
52
|
# A map from physical file path to tarball file path
|
@@ -70,14 +78,14 @@ module Stove
|
|
70
78
|
def tarball
|
71
79
|
# Generate the metadata.json on the fly
|
72
80
|
metadata_json = File.join(cookbook.path, 'metadata.json')
|
73
|
-
|
74
|
-
|
75
|
-
end
|
81
|
+
json = JSON.fast_generate(cookbook.metadata.to_hash(extended_metadata))
|
82
|
+
File.open(metadata_json, 'wb') { |f| f.write(json) }
|
76
83
|
|
77
84
|
io = tar(File.dirname(cookbook.path), packaging_slip)
|
78
85
|
tgz = gzip(io)
|
79
86
|
|
80
|
-
tempfile = Tempfile.new([cookbook.name, '.tar.gz'], Dir.tmpdir
|
87
|
+
tempfile = Tempfile.new([cookbook.name, '.tar.gz'], Dir.tmpdir)
|
88
|
+
tempfile.binmode
|
81
89
|
|
82
90
|
while buffer = tgz.read(1024)
|
83
91
|
tempfile.write(buffer)
|
data/lib/stove/version.rb
CHANGED
data/spec/support/generators.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class Stove::Cookbook
|
4
|
+
describe Metadata do
|
5
|
+
describe '#to_hash' do
|
6
|
+
context 'when the extra metadata is not included' do
|
7
|
+
it 'does not include the new metadata fields' do
|
8
|
+
hash = subject.to_hash(false)
|
9
|
+
expect(hash).to_not include('issues_url')
|
10
|
+
expect(hash).to_not include('source_url')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'when the extra metadata is included' do
|
15
|
+
it 'includes the new metadata fields' do
|
16
|
+
hash = subject.to_hash(true)
|
17
|
+
expect(hash).to include('issues_url')
|
18
|
+
expect(hash).to include('source_url')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stove
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Vargo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-api
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- spec/integration/cookbook_spec.rb
|
162
162
|
- spec/spec_helper.rb
|
163
163
|
- spec/support/generators.rb
|
164
|
+
- spec/unit/cookbook/metadata_spec.rb
|
164
165
|
- spec/unit/error_spec.rb
|
165
166
|
- stove.gemspec
|
166
167
|
- templates/errors/abstract_method.erb
|
@@ -193,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
194
|
version: '0'
|
194
195
|
requirements: []
|
195
196
|
rubyforge_project:
|
196
|
-
rubygems_version: 2.
|
197
|
+
rubygems_version: 2.2.3
|
197
198
|
signing_key:
|
198
199
|
specification_version: 4
|
199
200
|
summary: A command-line utility for releasing Chef community cookbooks
|
@@ -211,5 +212,5 @@ test_files:
|
|
211
212
|
- spec/integration/cookbook_spec.rb
|
212
213
|
- spec/spec_helper.rb
|
213
214
|
- spec/support/generators.rb
|
215
|
+
- spec/unit/cookbook/metadata_spec.rb
|
214
216
|
- spec/unit/error_spec.rb
|
215
|
-
has_rdoc:
|