Created
January 19, 2011 21:38
-
-
Save aantix/786917 to your computer and use it in GitHub Desktop.
RSyncs all svn changed files to a remote VM volume. Useful when you want to test changes on a remote VM, but not necessarily commit them to the SVN trunk.
This file contains 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 | |
ignore_patterns = ["db/","test","log","reports","server","vendor/","Gemfile","tmp",".idea","config/",".DS_Store", ".xml", '.zip'] | |
ignore_statuses = ['!','D','?'] | |
changed_files = (`svn status`).split("\n").collect do |e| | |
p = e.split(/\s+/) | |
ignore_statuses.include?(p[0]) ? nil : p[p.size - 1] | |
end.compact | |
filtered_files = changed_files.select {|cf| !(ignore_patterns.any?{|ip| (cf =~ /#{Regexp.escape(ip)}/)})} | |
puts "Syncing..." | |
filtered_files.each do |ff| | |
puts " #{ff}" | |
`rsync #{ff} <username>@<server address>:/remote/server/volume/#{ff}` | |
end | |
puts "Done syncing." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment