Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependency on chef to Chef17 #51

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.5', '2.7']
ruby-version: ['2.7']
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
6 changes: 3 additions & 3 deletions cookbook-release.gemspec
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ require 'English'

Gem::Specification.new do |spec|
spec.name = 'cookbook-release'
spec.version = '1.9.0'
spec.version = '2.0.0'
spec.authors = ['Grégoire Seux']
spec.email = '[email protected]'
spec.summary = 'Provide primitives (and rake tasks) to release a cookbook'
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
spec.add_dependency 'semantic'
spec.add_dependency 'highline'
spec.add_dependency 'mixlib-shellout'
# TODO: support Chef 17 and leverage knife gem at some point
spec.add_dependency 'chef', '>= 12.18.31', '< 17.0' # knife code has been moved to dedicated gem starting with Chef 17
spec.add_dependency 'chef', '>= 17'
spec.add_dependency 'knife', '>= 17'
spec.add_dependency 'git'
spec.add_dependency 'unicode-emoji'

6 changes: 3 additions & 3 deletions lib/cookbook-release/supermarket.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'chef/cookbook_loader'
require 'chef/cookbook/cookbook_version_loader'
require 'chef/cookbook_uploader'
require 'chef/cookbook_site_streaming_uploader'
require 'chef/knife/core/cookbook_site_streaming_uploader'
require 'chef/mixin/shell_out'
require 'json'

@@ -28,7 +28,7 @@ def publish_ck(category, path = nil)
# client.pem key
::Chef::CookbookUploader.new(cookbook, rest: 'fake_rest').validate_cookbooks

tmp_cookbook_dir = Chef::CookbookSiteStreamingUploader.create_build_dir(cookbook)
tmp_cookbook_dir = ::Chef::Knife::Core::CookbookSiteStreamingUploader.create_build_dir(cookbook)
begin
shell_out!("tar -czf #{cookbook.name}.tgz #{cookbook.name}", :cwd => tmp_cookbook_dir)
rescue StandardError => e
@@ -46,7 +46,7 @@ def publish_ck(category, path = nil)
end

def upload(filename, category)
http_resp = ::Chef::CookbookSiteStreamingUploader.post(
http_resp = ::Chef::Knife::Core::CookbookSiteStreamingUploader.post(
@url,
@user_id,
@client_key,
2 changes: 1 addition & 1 deletion spec/supermarket_spec.rb
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ def init_cookbook
body: "{}",
code: "201"
)
expect(::Chef::CookbookSiteStreamingUploader).
expect(::Chef::Knife::Core::CookbookSiteStreamingUploader).
to receive(:post).
with('http://a_url', 'a_name', 'a_file', anything()).
and_return(response)