Created
July 3, 2014 20:20
-
-
Save danmayer/e4be42ede2d30b52afe7 to your computer and use it in GitHub Desktop.
gem update in progress
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
GEM_NAME = "ls-secure_gmaps" | |
COMMIT_MESSAGE = "update to latest ls-secure_gmaps\n This makes sure all calls are made with the correct keys for our new contract" | |
APPS = ["browse", "browse-service", "escapes", "events", "preferences", "sponsors"] | |
CMDS = ["git pull origin master", | |
"bundle install", | |
"bundle exec rake", | |
"bundle update #{GEM_NAME}", | |
"bundle exec rake", | |
"git checkout -b update_gem_#{GEM_NAME.gsub('-','_')}", | |
"git add .", | |
"git commit -a -m \"#{COMMIT_MESSAGE}\"", | |
"git push dan update_gem_#{GEM_NAME.gsub('-','_')}", | |
"hub pull-request" | |
] | |
def run_cmd(cmd) | |
puts "running: #{cmd}" | |
`#{cmd}` | |
if($?.exitstatus > 0) | |
puts "command failed to run: #{cmd}" | |
raise "command failed: #{cmd}" | |
else | |
puts "command finished successfully: #{cmd}" | |
end | |
end | |
APPS.each do |app| | |
puts "running app #{app}" | |
Dir.chdir("/Users/danmayer/projects/#{app}") do |path| | |
begin | |
CMDS.each do |cmd| | |
run_cmd(cmd) | |
end | |
rescue => error | |
puts "the app #{app} failed to update because of this command #{error}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment