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

[Breaking] drop berkshelf support #37

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
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
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Options:
- generate changelogs for some supermarket hosted cookbooks
- generate changelogs for all git located cookbooks

This plugin works in policyfile style repositories or classical repositories with a Berksfile
This plugin works in policyfile style repositories

## Todos

Expand Down
5 changes: 3 additions & 2 deletions knife-changelog.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
spec.name = 'knife-changelog'
spec.version = '2.0.0'
spec.version = '3.0.0'
spec.authors = ['Gregoire Seux']
spec.email = ['[email protected]']
spec.summary = 'Facilitate access to cookbooks changelog'
spec.description = ''
spec.homepage = 'https://github.com/kamaradclimber/knife-changelog'
spec.license = 'MIT'

spec.required_ruby_version = '>= 2.7'

spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
Expand All @@ -24,7 +26,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'webmock'

spec.add_dependency 'berkshelf'
spec.add_dependency 'chef'
spec.add_dependency 'chef-cli'
spec.add_dependency 'deep_merge'
Expand Down
51 changes: 5 additions & 46 deletions lib/chef/knife/changelog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,9 @@ class Changelog < Knife
banner 'knife changelog COOKBOOK [COOKBOOK ...]'

deps do
require 'knife/changelog/changelog'
require 'knife/changelog/berksfile'
require 'berkshelf'
require 'knife/changelog/policyfile'
end

option :linkify,
short: '-l',
long: '--linkify',
description: 'add markdown links where relevant',
boolean: true

option :markdown,
short: '-m',
long: '--markdown',
description: 'use markdown syntax',
boolean: true

option :ignore_changelog_file,
long: '--ignore-changelog-file',
description: 'Ignore changelog file presence, use git history instead',
boolean: true

option :allow_update_all,
long: '--allow-update-all',
description: 'If no cookbook given, check all Berksfile',
boolean: true,
default: true

option :submodules,
long: '--submodules SUBMODULE[,SUBMODULE]',
description: 'Submoduless to check for changes as well (comma separated)'

option :prevent_downgrade,
long: '--prevent-downgrade',
description: 'Fail if knife-changelog detect a cookbook downgrade',
Expand All @@ -59,24 +29,13 @@ class Changelog < Knife
boolean: true,
default: false

option :update,
long: '--update',
description: 'Update Berksfile'

def run
Log.info config.to_s
if config[:policyfile] && File.exist?(config[:policyfile])
puts PolicyChangelog.new(
@name_args,
config[:policyfile],
config[:with_dependencies]
).generate_changelog
else
berksfile = Berkshelf::Berksfile.from_options({})
puts KnifeChangelog::Changelog::Berksfile
.new(berksfile, config)
.run(@name_args)
end
puts PolicyChangelog.new(
@name_args,
config[:policyfile],
config[:with_dependencies]
).generate_changelog(config[:prevent_downgrade])
end
end
end
Expand Down
68 changes: 0 additions & 68 deletions lib/knife/changelog/berksfile.rb

This file was deleted.

Loading
Loading