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

Use structured fact for Jenkins plugin list #1050

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions lib/facter/jenkins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Facter.add(:jenkins_plugins) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For compatibility I toyed with the idea to create a structured jenkins fact where plugins is a key, but I had issues testing it properly and then had a lack of time. I also thought it would be good to reduce the number of entries.

Facter.add(:jenkins, type: :aggregate) do
  confine kernel: 'Linux'

  chunk :plugins do
    plugins = Puppet::Jenkins::Plugins.available
    plugins.transform_values { |plugin| plugin.slice(:plugin_version) }
  end
end

confine kernel: 'Linux'
setcode do
plugins = Puppet::Jenkins::Plugins.available
plugins.keys.sort.map { |plugin| "#{plugin} #{plugins[plugin][:plugin_version]}" }.join(', ')
Puppet::Jenkins::Plugins.available
end
end
end