Created
October 20, 2015 22:11
-
-
Save joshcooper/ce2e49e0ca6372326450 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| STABLE_URL="https://jenkins.puppetlabs.com/view/All%20in%20One%20Agent/view/Stable/view/Puppet%20Agent%20Daily/job/platform_aio-suite_stage-intn_stable/api/json" | |
| MASTER_URL="https://jenkins.puppetlabs.com/view/All%20in%20One%20Agent/view/Master/view/Puppet%20Agent%20Daily/job/platform_aio-suite_stage-intn_master/api/json" | |
| AARDWOLF_URL="https://jenkins.puppetlabs.com/view/All%20in%20One%20Agent/view/Aardwolf/job/platform_aio-suite_stage-intn_aardwolf/api/json" | |
| def get_targets(url, param) | |
| command = "curl -s #{url} | jq '.actions[2].parameterDefinitions[] | select(.name == \"#{param}_TARGETS\").defaultParameterValue.value'" | |
| targets = %x{ #{command} }.chomp | |
| targets.gsub!(/\A"|"\Z/, '') # strip leading & trailing quote | |
| targets = targets.split(' ') | |
| targets.sort | |
| end | |
| def compare(left, right) | |
| puts "In #{left[:name]}, but not #{right[:name]}" | |
| puts " BUILD_TARGETS" | |
| (left[:build_targets] - right[:build_targets]).each do |target| | |
| puts " #{target}" | |
| end | |
| puts "\n TEST_TARGETS" | |
| (left[:test_targets] - right[:test_targets]).each do |target| | |
| puts " #{target}" | |
| end | |
| puts | |
| end | |
| builds = { | |
| :stable => | |
| { | |
| :name => :stable, | |
| :build_targets => get_targets(STABLE_URL, 'BUILD'), | |
| :test_targets => get_targets(STABLE_URL, 'TEST') | |
| }, | |
| :master => | |
| { | |
| :name => :master, | |
| :build_targets => get_targets(MASTER_URL, 'BUILD'), | |
| :test_targets => get_targets(MASTER_URL, 'TEST') | |
| }, | |
| :aardwolf => | |
| { | |
| :name => :aardwolf, | |
| :build_targets => get_targets(AARDWOLF_URL, 'BUILD'), | |
| :test_targets => get_targets(AARDWOLF_URL, 'TEST') | |
| } | |
| } | |
| compare(builds[:stable], builds[:master]) | |
| compare(builds[:master], builds[:stable]) | |
| compare(builds[:stable], builds[:aardwolf]) | |
| compare(builds[:aardwolf], builds[:stable]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment