Created
June 6, 2016 20:29
-
-
Save eherot/be10d5d236f98e053e6b47c4eb8b5dea to your computer and use it in GitHub Desktop.
Check which cookbooks haven't been promoted to prod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chef' | |
require 'chef/knife' | |
Chef::Knife.new.configure_chef | |
rest = Chef::ServerAPI.new Chef::Config[:chef_server_url] | |
cookbooks = rest.get_rest 'cookbooks' | |
rest.get_rest('environments/prod')['cookbook_versions'].reject do |cb,v| | |
Gem::Dependency.new('', v).match?('', cookbooks[cb]['versions'].sort_by{|k|k['version']}.first['version']) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment