Skip to content

Instantly share code, notes, and snippets.

@sathishmanohar
Created August 3, 2012 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sathishmanohar/3251221 to your computer and use it in GitHub Desktop.
Save sathishmanohar/3251221 to your computer and use it in GitHub Desktop.
capistrano basic deploy file, tested with amazon ec2
# cd into_project
# Add Following Contents to the Gemfile
# gem 'capistrano'
# gem 'rvm-capistrano'
# run capify .
# Use the generated config/deploy.rb and populate/customize it with below content
require 'bundler/capistrano'
require 'rvm/capistrano'
#server login details
set :user, 'ubuntu'
set :domain, 'ec2-72-44-39-164.compute-1.amazonaws.com'
set :rvm_ruby_string, '1.9.3@rails322'
set :use_sudo, false
#version control details
set :scm, 'git'
set :repository, "git@bitbucket.org:sathishmanohar/dabba-dictionary.git"
set :branch, 'master'
set :git_shallow_clone, 1
ssh_options[:forward_agent] = true
# roles (servers)
role :web, domain
role :app, domain
role :db, domain, :primary => true
# deploy config
set :deploy_to, "/home/ubuntu/apps/dictionary"
set :deploy_via, :remote_cache
# Passenger
namespace :deploy do
task :start do ; end
task :stop do ; end
desc "Tell Passenger to restart"
task :restart, :roles => :web do
run "touch #{deploy_to}/current/tmp/restart.txt"
end
end
after "deploy", "deploy:cleanup" # keeps only last 5 releases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment