Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Capistrano recipe for deploying static content.
set :application, "My Static Content"
set :servername, ''
# no git? simply deploy a directory
set :scm, :none
set :repository, "." # the directory to deploy
# using git? deploy from local git repository
# set :scm, :git
# set :repository, 'file//.' # path to local git repository
# files will get copied over
set :deploy_via, :copy
# do not copy these files, adjust to your needs
set :copy_exclude, [".git", ".gitignore", "Capfile", ".config"]
# the remote user
set :user, 'username'
set :use_sudo, false
# directory where our release and current directories will live
set :deploy_to, '/var/www/static/my-site'
role :web, servername
role :app, servername
role :db, servername, :primary => true
# Override default tasks which are not relevant to a non-rails app.
namespace :deploy do
task :migrate do
puts "Skipping migrate."
task :finalize_update do
puts "Skipping finalize_update."
task :start do
puts "Skipping start."
task :stop do
puts "Skipping stop."
task :restart do
puts "Skipping restart."
# leave only 5 releases
after "deploy", "deploy:cleanup"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment