stove 5.2.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a7b6e003eaa819a032278c65bdb28317ba36543
4
- data.tar.gz: 71ab7d2ff0f46152784c3e4d0d60dec1cf157f01
3
+ metadata.gz: 390277d48cb42db0d622b67242398c2356a64caa
4
+ data.tar.gz: 5d62fb5adb3ab6433d2dd3a2cae863833e52ebda
5
5
  SHA512:
6
- metadata.gz: cf2361dfafbaaca8e631d0b807f6b08c9fb0c1322c0865a7ac1188fc07c1e3ada760b4bd2af1712f2e295b5595d8bd3cc0869e82a534d0f0fd71f97ea953c5c7
7
- data.tar.gz: a8a0a61d146ac8c7df835a5ff6613528d69c664e293edbffeca7fd7b8a9c8cf34f642f7a2c2492360615ac0c75b8f42116d96d299ea485ce637156692ed83ec1
6
+ metadata.gz: 5434acb284472d0f408b3e14215942faa47acb190a88147b1d651a54520d19bdd7e55fa5c6932af26de61f4baadf37c676c7e3413bce4d24c834172789812906
7
+ data.tar.gz: c9df46d77f1c1b61aa22e865ad1df556d8b34f87927019bdc877b3ec5ba0a0cb84459d0f94bc680c867a4a4a816ad5c9009fdf8f579126d205775c020e9cec15
@@ -2,6 +2,19 @@
2
2
 
3
3
  This is the Changelog for the Stove gem.
4
4
 
5
+ ## v6.0.0
6
+
7
+ ### Breaking Changes
8
+
9
+ - All references to the Community site have been renamed to Supermarket. This includes the name of the `community` plugin and all `Community` classes references within the code. This should not be a breaking change unless your developing against stove as a library.
10
+ - The long ago deprecated `bake` command has been removed.
11
+
12
+ ### Other Changes
13
+
14
+ - Git tagging errors now include more useful error messaging.
15
+ - The help command now better describes `--no-git` and `--endpoint` flags.
16
+ - For developers running stove from the git repository, the application now properly loads stove from the repository instead of from an installed gem.
17
+
5
18
  ## v5.2.0 (2017-05-12)
6
19
 
7
20
  - Support for uploading to Artifactory
data/bin/stove CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ $:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
3
4
  require 'stove'
4
5
  Stove::Cli.new(ARGV.dup).execute!
@@ -1,4 +1,4 @@
1
- Feature: Community
1
+ Feature: Supermarket
2
2
  Background:
3
3
  * I have a cookbook named "bacon"
4
4
 
@@ -13,25 +13,25 @@ Feature: Community
13
13
  * it should fail with "requires a private key"
14
14
 
15
15
  Scenario: With the default parameters
16
- * the community server has the cookbook:
16
+ * the supermarket has the cookbook:
17
17
  | bacon | 1.2.3 |
18
18
  * I successfully run `stove --no-git`
19
- * the community server will have the cookbooks:
19
+ * the supermarket will have the cookbooks:
20
20
  | bacon | 0.0.0 |
21
21
 
22
22
  Scenario: Yanking a cookbook
23
- * the community server has the cookbooks:
23
+ * the supermarket has the cookbooks:
24
24
  | bacon | 1.2.3 |
25
25
  * I successfully run `stove yank -l debug`
26
- * the community server will not have the cookbooks:
26
+ * the supermarket will not have the cookbooks:
27
27
  | bacon | 1.2.3 |
28
28
  * the output should contain "Successfully yanked bacon!"
29
29
 
30
30
  Scenario: Yanking a cookbook by name
31
- * the community server has the cookbooks:
31
+ * the supermarket has the cookbooks:
32
32
  | eggs | 4.5.6 |
33
33
  * I successfully run `stove yank eggs`
34
- * the community server will not have the cookbooks:
34
+ * the supermarket will not have the cookbooks:
35
35
  | eggs | 4.5.6 |
36
36
  * the output should not contain "Successfully yanked bacon!"
37
37
  * the output should contain "Successfully yanked eggs!"
@@ -1,7 +1,7 @@
1
1
  Feature: git Plugin
2
2
  Background:
3
3
  * I have a cookbook named "bacon"
4
- * the community server has the cookbooks:
4
+ * the supermarket has the cookbooks:
5
5
  | bacon | 1.0.0 |
6
6
 
7
7
  Scenario: When the directory is not a git repository
@@ -1,4 +1,4 @@
1
- Given /^the community server has the cookbooks?:$/ do |table|
1
+ Given /^the supermarket has the cookbooks?:$/ do |table|
2
2
  table.raw.each do |name, version|
3
3
  version ||= '0.0.0'
4
4
 
@@ -10,7 +10,7 @@ Given /^the community server has the cookbooks?:$/ do |table|
10
10
  end
11
11
  end
12
12
 
13
- Then /^the community server will( not)? have the cookbooks?:$/ do |negate, table|
13
+ Then /^the supermarket will( not)? have the cookbooks?:$/ do |negate, table|
14
14
  table.raw.each do |name, version|
15
15
  cookbook = CommunityZero::RSpec.store.find(name, version)
16
16
 
@@ -3,7 +3,7 @@ require 'pathname'
3
3
 
4
4
  module Stove
5
5
  autoload :Artifactory, 'stove/artifactory'
6
- autoload :Community, 'stove/community'
6
+ autoload :Supermarket, 'stove/supermarket'
7
7
  autoload :Config, 'stove/config'
8
8
  autoload :Cookbook, 'stove/cookbook'
9
9
  autoload :Cli, 'stove/cli'
@@ -31,7 +31,7 @@ module Stove
31
31
  module Plugin
32
32
  autoload :Artifactory, 'stove/plugins/artifactory'
33
33
  autoload :Base, 'stove/plugins/base'
34
- autoload :Community, 'stove/plugins/community'
34
+ autoload :Supermarket, 'stove/plugins/supermarket'
35
35
  autoload :Git, 'stove/plugins/git'
36
36
  end
37
37
 
@@ -55,7 +55,7 @@ module Stove
55
55
  if @argv.first == 'yank'
56
56
  name = @argv[1] || Cookbook.new(options[:path]).name
57
57
 
58
- if Community.yank(name)
58
+ if Supermarket.yank(name)
59
59
  @stdout.puts "Successfully yanked #{name}!"
60
60
  @kernel.exit(0)
61
61
  else
@@ -101,14 +101,14 @@ module Stove
101
101
  opts.separator ''
102
102
  opts.separator 'Plugins:'
103
103
 
104
- opts.on('--no-git', 'Do not use the git plugin') do
104
+ opts.on('--no-git', 'Do not use the git plugin. Skips tagging if specified.') do
105
105
  options[:no_git] = true
106
106
  end
107
107
 
108
108
  opts.separator ''
109
109
  opts.separator 'Upload Options:'
110
110
 
111
- opts.on('--endpoint [URL]', 'Upload URL endpoint') do |v|
111
+ opts.on('--endpoint [URL]', 'Supermarket endpoint') do |v|
112
112
  options[:endpoint] = v
113
113
  end
114
114
 
@@ -17,7 +17,7 @@ module Stove
17
17
 
18
18
  #
19
19
  # The name of the cookbook (must correspond to the name of the
20
- # cookbook on the community site).
20
+ # cookbook on the Supermarket).
21
21
  #
22
22
  # @return [String]
23
23
  #
@@ -71,7 +71,7 @@ module Stove
71
71
  end
72
72
 
73
73
  #
74
- # Deterine if this cookbook version is released on the community site
74
+ # Deterine if this cookbook version is released on the Supermarket
75
75
  #
76
76
  # @warn
77
77
  # This is a fairly expensive operation and the result cannot be
@@ -82,7 +82,7 @@ module Stove
82
82
  # site, false otherwise
83
83
  #
84
84
  def released?
85
- Community.cookbook(name, version)
85
+ Supermarket.cookbook(name, version)
86
86
  true
87
87
  rescue ChefAPI::Error::HTTPNotFound
88
88
  false
@@ -5,7 +5,7 @@ module Stove
5
5
  # Borrowed and modified from:
6
6
  # {https://raw.github.com/opscode/chef/11.4.0/lib/chef/cookbook/metadata.rb}
7
7
  #
8
- # Copyright:: Copyright 2008-2010 Opscode, Inc.
8
+ # Copyright:: Copyright 2008-2017 Chef Software, Inc.
9
9
  #
10
10
  # Licensed under the Apache License, Version 2.0 (the "License");
11
11
  # you may not use this file except in compliance with the License.
@@ -38,15 +38,16 @@ module Stove
38
38
  end
39
39
 
40
40
  class GitFailed < StoveError; end
41
+ class GitTaggingFailed < StoveError; end
41
42
  class MetadataNotFound < StoveError; end
42
43
  class ServerUnavailable < StoveError; end
43
44
  class CookbookAlreadyExists < StoveError; end
44
45
 
45
46
  # Validations
46
47
  class ValidationFailed < StoveError; end
47
- class CommunityCategoryValidationFailed < ValidationFailed; end
48
- class CommunityKeyValidationFailed < ValidationFailed; end
49
- class CommunityUsernameValidationFailed < ValidationFailed; end
48
+ class SupermarketCategoryValidationFailed < ValidationFailed; end
49
+ class SupermarketKeyValidationFailed < ValidationFailed; end
50
+ class SupermarketUsernameValidationFailed < ValidationFailed; end
50
51
  class GitCleanValidationFailed < ValidationFailed; end
51
52
  class GitRepositoryValidationFailed < ValidationFailed; end
52
53
  class GitUpToDateValidationFailed < ValidationFailed; end
@@ -34,11 +34,13 @@ module Stove
34
34
  private
35
35
 
36
36
  def git(command, errors = true)
37
+ log.debug("the command matches")
37
38
  log.debug("Running `git #{command}', errors: #{errors}")
38
39
  Dir.chdir(cookbook.path) do
39
40
  response = %x|git #{command}|
40
41
 
41
42
  if errors && !$?.success?
43
+ raise Error::GitTaggingFailed.new(command: command) if command =~ /^tag/
42
44
  raise Error::GitFailed.new(command: command)
43
45
  end
44
46
 
@@ -0,0 +1,18 @@
1
+ module Stove
2
+ class Plugin::Supermarket < Plugin::Base
3
+ id 'supermarket'
4
+ description 'Publish the release to the Chef Supermarket'
5
+
6
+ validate(:username) do
7
+ Config.username
8
+ end
9
+
10
+ validate(:key) do
11
+ Config.key
12
+ end
13
+
14
+ run('Publishing the release to the Chef Supermarket') do
15
+ Supermarket.upload(cookbook, options[:extended_metadata])
16
+ end
17
+ end
18
+ end
@@ -15,7 +15,7 @@ module Stove
15
15
  if Config.artifactory
16
16
  run_plugin :artifactory
17
17
  else
18
- run_plugin :community
18
+ run_plugin :supermarket
19
19
  end
20
20
  end
21
21
 
@@ -1,12 +1,12 @@
1
1
  require 'chef-api'
2
2
 
3
3
  module Stove
4
- class Community
4
+ class Supermarket
5
5
  include Mixin::Instanceable
6
6
  include Mixin::Optionable
7
7
 
8
8
  #
9
- # The default endpoint where the community site lives.
9
+ # The default endpoint where the Supermarket lives.
10
10
  #
11
11
  # @return [String]
12
12
  #
@@ -17,19 +17,19 @@ module Stove
17
17
  # and version.
18
18
  #
19
19
  # @example Find a cookbook by name
20
- # Community.cookbook('apache2') #=> {...}
20
+ # Supermarket.cookbook('apache2') #=> {...}
21
21
  #
22
22
  # @example Find a cookbook by name and version
23
- # Community.cookbook('apache2', '1.0.0') #=> {...}
23
+ # Supermarket.cookbook('apache2', '1.0.0') #=> {...}
24
24
  #
25
25
  # @example Find a non-existent cookbook
26
- # Community.cookbook('not-real') #=> Community::BadResponse
26
+ # Supermarket.cookbook('not-real') #=> Community::BadResponse
27
27
  #
28
- # @raise [Community::BadResponse]
29
- # if the given cookbook (or cookbook version) does not exist on the community site
28
+ # @raise [Supermarket::BadResponse]
29
+ # if the given cookbook (or cookbook version) does not exist on the Supermarket
30
30
  #
31
31
  # @param [String] name
32
- # the name of the cookbook on the community site
32
+ # the name of the cookbook on the Supermarket
33
33
  # @param [String] version (optional)
34
34
  # the version of the cookbook to find
35
35
  #
@@ -63,7 +63,7 @@ module Stove
63
63
  end
64
64
 
65
65
  #
66
- # Delete the given cookbook from the community site.
66
+ # Delete the given cookbook from the supermarket.
67
67
  #
68
68
  # @param [String] name
69
69
  # the name of the cookbook to delete
@@ -1,3 +1,3 @@
1
1
  module Stove
2
- VERSION = '5.2.0'
2
+ VERSION = '6.0.0'
3
3
  end
@@ -49,12 +49,12 @@ module Stove::Error
49
49
  end
50
50
  end
51
51
 
52
- describe CommunityKeyValidationFailed do
52
+ describe SupermarketKeyValidationFailed do
53
53
  it 'raises an exception with the correct message' do
54
54
  expect { raise described_class }.to raise_error { |error|
55
55
  expect(error).to be_a(described_class)
56
56
  expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
57
- You did not specify the path to a private key! The Chef community site requires a private key for authentication:
57
+ You did not specify the path to a private key! The Chef Supermarket requires a private key for authentication:
58
58
 
59
59
  stove --key ~/.chef/sethvargo.pem
60
60
  EOH
@@ -62,12 +62,12 @@ module Stove::Error
62
62
  end
63
63
  end
64
64
 
65
- describe CommunityUsernameValidationFailed do
65
+ describe SupermarketUsernameValidationFailed do
66
66
  it 'raises an exception with the correct message' do
67
67
  expect { raise described_class }.to raise_error { |error|
68
68
  expect(error).to be_a(described_class)
69
69
  expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
70
- You did not specify the username to authenticate with! The Chef community site requires a username for authentication:
70
+ You did not specify the username to authenticate with! The Chef Supermarket requires a username for authentication:
71
71
 
72
72
  stove --username sethvargo
73
73
  EOH
@@ -0,0 +1,5 @@
1
+ An error occurred while attempting to tag the release in git by running:
2
+
3
+ git <%= @command %>
4
+
5
+ This often occurs when you've already attempted to release a cookbook with stove. If you would like to try to release again without git tagging use the '--no-git' option
@@ -0,0 +1,3 @@
1
+ You did not specify the path to a private key! The Chef Supermarket requires a private key for authentication:
2
+
3
+ stove --key ~/.chef/sethvargo.pem
@@ -1,3 +1,3 @@
1
- You did not specify the username to authenticate with! The Chef community site requires a username for authentication:
1
+ You did not specify the username to authenticate with! The Chef Supermarket requires a username for authentication:
2
2
 
3
3
  stove --username sethvargo
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: 5.2.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-12 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-api
@@ -140,7 +140,6 @@ description: A utility for releasing Chef community cookbooks
140
140
  email:
141
141
  - sethvargo@gmail.com
142
142
  executables:
143
- - bake
144
143
  - stove
145
144
  extensions: []
146
145
  extra_rdoc_files: []
@@ -152,7 +151,6 @@ files:
152
151
  - LICENSE
153
152
  - README.md
154
153
  - Rakefile
155
- - bin/bake
156
154
  - bin/stove
157
155
  - features/plugins/community.feature
158
156
  - features/plugins/git.feature
@@ -167,7 +165,6 @@ files:
167
165
  - lib/stove.rb
168
166
  - lib/stove/artifactory.rb
169
167
  - lib/stove/cli.rb
170
- - lib/stove/community.rb
171
168
  - lib/stove/config.rb
172
169
  - lib/stove/cookbook.rb
173
170
  - lib/stove/cookbook/metadata.rb
@@ -181,10 +178,11 @@ files:
181
178
  - lib/stove/packager.rb
182
179
  - lib/stove/plugins/artifactory.rb
183
180
  - lib/stove/plugins/base.rb
184
- - lib/stove/plugins/community.rb
185
181
  - lib/stove/plugins/git.rb
182
+ - lib/stove/plugins/supermarket.rb
186
183
  - lib/stove/rake_task.rb
187
184
  - lib/stove/runner.rb
185
+ - lib/stove/supermarket.rb
188
186
  - lib/stove/util.rb
189
187
  - lib/stove/validator.rb
190
188
  - lib/stove/version.rb
@@ -201,16 +199,17 @@ files:
201
199
  - stove.gemspec
202
200
  - templates/errors/abstract_method.erb
203
201
  - templates/errors/artifactory_key_validation_failed.erb
204
- - templates/errors/community_key_validation_failed.erb
205
- - templates/errors/community_username_validation_failed.erb
206
- - templates/errors/cookbook_already_exists.erb
207
202
  - templates/errors/git_clean_validation_failed.erb
208
203
  - templates/errors/git_failed.erb
209
204
  - templates/errors/git_repository_validation_failed.erb
205
+ - templates/errors/git_tagging_failed.erb
210
206
  - templates/errors/git_up_to_date_validation_failed.erb
211
207
  - templates/errors/metadata_not_found.erb
212
208
  - templates/errors/server_unavailable.erb
213
209
  - templates/errors/stove_error.erb
210
+ - templates/errors/supermarket_already_exists.erb
211
+ - templates/errors/supermarket_key_validation_failed.erb
212
+ - templates/errors/supermarket_username_validation_failed.erb
214
213
  homepage: https://github.com/sethvargo/stove
215
214
  licenses:
216
215
  - Apache 2.0
@@ -231,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
230
  version: '0'
232
231
  requirements: []
233
232
  rubyforge_project:
234
- rubygems_version: 2.6.11
233
+ rubygems_version: 2.6.13
235
234
  signing_key:
236
235
  specification_version: 4
237
236
  summary: A command-line utility for releasing Chef community cookbooks
data/bin/bake DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $stderr.puts "The `bake' command is deprecated. Please use `stove' instead!"
4
-
5
- require 'stove'
6
- Stove::Cli.new(ARGV.dup).execute!
@@ -1,18 +0,0 @@
1
- module Stove
2
- class Plugin::Community < Plugin::Base
3
- id 'community'
4
- description 'Publish the release to the Chef community site'
5
-
6
- validate(:username) do
7
- Config.username
8
- end
9
-
10
- validate(:key) do
11
- Config.key
12
- end
13
-
14
- run('Publishing the release to the Chef community site') do
15
- Community.upload(cookbook, options[:extended_metadata])
16
- end
17
- end
18
- end
@@ -1,3 +0,0 @@
1
- You did not specify the path to a private key! The Chef community site requires a private key for authentication:
2
-
3
- stove --key ~/.chef/sethvargo.pem