Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 29 lines (17 sloc) 691 Bytes
#!/usr/bin/env ruby
require 'bundler/setup'
require 'restclient'
require 'json'
print "latest jenkins version..."
jenkins_metadata = JSON.parse RestClient.get("").split("\n")[1..-2].join("\n")
puts current_jenkins_version = jenkins_metadata['core']['version']
print "latest gem version..."
gem_metadata = JSON.parse RestClient.get("")
puts current_gem_version = gem_metadata['version']
if current_jenkins_version > current_gem_version
puts "upgrading..."
exec "rake push[#{current_jenkins_version}]"
puts "no need to upgrade. current gem is the latest"