Created
February 11, 2011 04:34
-
-
Save bdeterling/821925 to your computer and use it in GitHub Desktop.
Example of using Capistrano for a static website
This file contains 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
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, "[email protected]:#{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