Skip to content

Instantly share code, notes, and snippets.

@jjuarez
Created January 10, 2018 11:58
Show Gist options
  • Save jjuarez/747880259c3d0c0b62c87e2a5714fec4 to your computer and use it in GitHub Desktop.
Save jjuarez/747880259c3d0c0b62c87e2a5714fec4 to your computer and use it in GitHub Desktop.
This scripts show the list of plugins deployed in a Jenkins instance
#!/usr/bin/env ruby
require 'yaml'
jenkins_server_hiera_config_file_name = File.expand_path('~/workspace/4iq/devops/cm/puppet/modules/puppet_control/data/role/jenkinsserver.yaml')
current_plugin_list = File.expand_path('./jenkins_server_deployed_plugins.lst')
plugins_deployed = YAML.load_file(jenkins_server_hiera_config_file_name)['jenkins_server::plugins'].keys.sort
plugins_self_deployed = [
'credentials',
'swarm'
]
File.open(current_plugin_list).each do |line|
plugin = line.split.first
puts plugin unless plugins_self_deployed.include?(plugin) || plugins_deployed.include?(plugin)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment