Created
December 8, 2011 18:53
-
-
Save jdcantrell/1448036 to your computer and use it in GitHub Desktop.
Base Guardfile for local dev on FeDev
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
# Add files and commands to this file, like the example: | |
# watch('file/path') { `command(s)` } | |
# | |
# | |
$username = 'jcantrell'; | |
guard 'shell' do | |
def sync(from, to) | |
system("rsync -avz ./#{from}/ #{$username}@fedev.utah.trulia.com:#{to}/ --exclude '.svn'") | |
Notifier.notify("#{from} is up to date.", {title: "Sync Complete"}) | |
end | |
def sync_common(from, to, file) | |
#todo move this if check to regex | |
if file.index(".svn") == nil | |
sync(from, "/home/#{$username}/svn/#{to}") | |
end | |
end | |
def sync_www(from, to, file) | |
if file.index(".svn") == nil | |
sync(from, "/home/#{$username}/public_html/#{to}") | |
end | |
end | |
#common repos | |
watch( %r{^common/.*} ) { |m| sync_common('common', 'common', m[0]) } | |
#playground and others | |
watch( %r{^playground} ) { |m| sync_www('playground', 'playground', m[0]) } | |
#current working branches | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment