Created
May 14, 2014 09:41
-
-
Save redroot/60f376ece87314a5299a to your computer and use it in GitHub Desktop.
Working version of the https://gist.github.com/redroot/acf3b8235ba8cb99ae2b
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
| namespace :update do | |
| task :services do | |
| REPOS.each do |repo_path| | |
| uncommitted_files = `cd #{repo_path} && git status --porcelain | wc -l`.strip.chomp.to_i | |
| if uncommitted_files == 0 | |
| puts "Updating #{repo_path} ..." | |
| puts `cd #{repo_path} && BUNDLE_GEMFILE=#{repo_path}/Gemfile bundle update config-gem` | |
| puts `cd #{repo_path} && git commit -a -m "Updated config-gem"` | |
| puts `cd #{repo_path} && git pull --rebase && git push` | |
| else | |
| puts "#{repo_path} has uncommitted files, skipping ..." | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment