Skip to content

Instantly share code, notes, and snippets.

@jjam3774
Created November 11, 2015 22:58
Show Gist options
  • Save jjam3774/79f9c9c71c38a0e33d9d to your computer and use it in GitHub Desktop.
Save jjam3774/79f9c9c71c38a0e33d9d to your computer and use it in GitHub Desktop.
This grabs the base url and then does a --force install via rpm.
#!/usr/bin/ruby
base_url = `grep baseurl /etc/yum.repos.d/service-centro.repo`.split[2]
#install_link = "#{base_url}kube_yamls-1.0-1.x86_64.rpm"
#install_link = "#{base_url}mysql_docker_build-1.0-1.x86_64.rpm"
install_link = "#{base_url}jboss_docker_build-1.0-1.x86_64.rpm"
begin
if File.exists?('/centro/target/centro-11.0.war')
puts "War is in place.."
else
IO.popen("rpm -ivh --force #{install_link}").each{|i|
puts i
}
end
rescue
puts "Install did not happen as planned. Please check the /etc/yum.repos/service-centro.repo file"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment