Skip to content

Commit

Permalink
Merge pull request #51 from criteo/chef17
Browse files Browse the repository at this point in the history
Bump dependency on chef to Chef17
  • Loading branch information
Mat-Co authored Jan 18, 2024
2 parents 881c96e + 927032d commit c440ff5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions cookbook-release.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'

Expand Down
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'

Expand All @@ -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
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion spec/supermarket_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c440ff5

Please sign in to comment.