Skip to content

Instantly share code, notes, and snippets.

@manufaktor
Created August 5, 2010 21:56
Show Gist options
  • Save manufaktor/510455 to your computer and use it in GitHub Desktop.
Save manufaktor/510455 to your computer and use it in GitHub Desktop.
set :application, 'domain'
set :deploy_to, '/var/www/domain.com'
set :repository, '.'
set :scm, :none
set :deploy_via, :copy
set :copy_compression, :gzip
set :use_sudo, false
set :user, 'domain_user'
set :copy_exclude, ['.git', 'src', '.sass-cache', 'Capfile', 'config']
role :web, 'domain.com' # Your HTTP server, Apache/etc
role :app, 'domain.com' # This may be the same as your `Web` server
role :db, 'domain.com', :primary => true # This is where Rails migrations will run
# when using passenger, this actually isn't necessary because we serve static stuff only, but anyway, this is how it's done
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
namespace :deploy do
desc 'Compiles the site from the /src dir into the /site dir'
task :build_site do
system 'staticmatic build .'
end
desc 'Symlinks the /site dir to /public'
task :symlink_site do
run "rm -rf #{current_path}/public && ln -s #{current_path}/site #{current_path}/public"
end
end
before 'deploy', 'deploy:build_site'
after 'deploy:symlink', 'deploy:symlink_site'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment