Skip to content

Instantly share code, notes, and snippets.

@bdeterling
Created February 11, 2011 04:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bdeterling/821925 to your computer and use it in GitHub Desktop.
Save bdeterling/821925 to your computer and use it in GitHub Desktop.
Example of using Capistrano for a static website
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
default_run_options[:pty] = true
# be sure to change these
set :github_user, '<github_user_name>'
set :github_application, "<repository_name>"
set :user, '<user_on_server>'
set :domain, '<server_name>'
set :application, '<domain_name_of_static_site>'
# the rest should be good
set :repository, "git@github.com:#{github_user}/#{github_application}.git"
set :deploy_to, "/var/apps/#{application}" # or whatever path you want to copy it to
set :deploy_via, :remote_cache
set :scm, 'git'
set :branch, 'master'
set :git_shallow_clone, 1
set :scm_verbose, true
set :use_sudo, false
server domain, :app, :web
# xbit is a script that runs chmod +x on all html files
# because the site uses server side includes
namespace :deploy do
task :xbit do
run "cd /var/apps/#{application}/current; ../xbit"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment