Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 58 lines (49 sloc) 1.35 KB
set :host, "linode"
set :path, "/var/www/seanhess.net"
role :live, "linode"
desc "DB"
namespace :db do
desc "Wipe out database"
task :migrate, :roles => :live do
run "cd #{path}; rake db:migrate"
end
task :scanall, :roles => :live do
run "cd #{path}; rake scan:all"
end
end
namespace :rake do
desc "Run a remote rake task"
task :migrate, :roles => :local do
run "cd #{path} ; rake db:migrate"
end
end
namespace :posts do
desc "Sync them to the server"
task :default, :roles => :live do
`rsync -avz --delete --exclude-from=.rysncignore "./posts" "#{host}:#{path}"`
`rsync -avz --delete --exclude-from=.rysncignore "./pages" "#{host}:#{path}"`
run "cd #{path}; rake scan:all"
run "cd #{path}; rake scan:trim"
end
end
desc "Sync"
namespace :deploy do
desc "Sync remote by default"
task :default do
remote.default
end
desc "Update the server's code"
task :update do
`git push origin master`
run 'cd #{path}; git pull origin master'
end
namespace :remote do
desc "Sync the code to the server"
task :default do
`rsync -avz --delete --exclude-from=.rysncignore "./" "#{host}:#{path}"`
run 'cd #{path}; touch tmp/restart.txt'
end
end
end
## You don't need to even create the directory
# rsync -avz --exclude-from=.rysncignore "./" "centosnew:/home/seanhess/Blog"