-
-
Save sxtxixtxcxh/763136 to your computer and use it in GitHub Desktop.
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
ssh_user = "[email protected]" # for rsync deployment | |
remote_root = "~/domain.com/path.to/project" # for rsync deployment | |
def fs_deploy(relative) | |
puts ">>> Change Detected to: #{relative} >> Deploying" | |
system("rake deploy") | |
end | |
desc "Watch the site and regenerate when it changes" | |
task :watch do | |
require 'fssm' | |
puts ">>> Watching for Changes" | |
FSSM.monitor(".", '**/*') do | |
update {|base, relative| fs_deploy relative} | |
delete {|base, relative| fs_deploy relative} | |
create {|base, relative| fs_deploy relative } | |
end | |
end | |
desc "Deploy the site." | |
task :deploy do | |
puts "*** Deploying the site ***" | |
system("rsync -avz ./ #{ssh_user}:#{remote_root}") | |
end | |
desc "Merge remote to local." | |
task :merge do | |
puts "*** Merging remote to local ***" | |
system("rsync -avz #{ssh_user}:#{remote_root}/* ./") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment