Created
January 15, 2012 22:31
-
-
Save mgswolf/1617760 to your computer and use it in GitHub Desktop.
Example Capistrano GIT and RVM on Amazon EC2
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
# General | |
ssh_options[:keys] = ["#{ENV['HOME']}/.ssh/amazon.pem"] | |
set :application, "test_app" | |
set :user, "ubuntu" | |
set :domain, "your_domain.com" | |
set :deploy_to, "/home/#{user}/#{application}" | |
set :deploy_via, :copy | |
set :use_sudo, false | |
# Bundler | |
require "bundler/capistrano" | |
#Asset Pipeline | |
load 'deploy/assets' | |
# RVM | |
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) | |
require "rvm/capistrano" | |
set :rvm_ruby_string, "1.9.2" | |
set :rvm_type, :user | |
# Git | |
#This example is using local repository | |
set :scm, :git | |
set :repository, "~/#{application}/.git" | |
set :branch, "master" | |
# Server | |
role :web, domain | |
role :app, domain | |
role :db, domain, :primary => true | |
# Passenger | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment