Created
July 11, 2011 22:35
-
-
Save juniorz/1076956 to your computer and use it in GitHub Desktop.
Configuração de exemplo para o Capistrano
This file contains hidden or 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
#Vendoriza as gems automatizamente usando o Bundler | |
require "bundler/capistrano" | |
default_run_options[:pty] = true | |
ssh_options[:forward_agent] = true # Permite que o deploy use minhas chaves ssh | |
#Aplicação | |
set :application, "mytestapp" #nome da aplicação | |
#Os endereços dos diferentes servidores envolvidos no deployment | |
role :web, "mytestapp.reinaldojunior.net" | |
role :app, "mytestapp.reinaldojunior.net" | |
role :db, "mytestapp.reinaldojunior.net", :primary => true | |
#Informações do Repositório | |
set :scm, :git | |
set :repository, "[email protected]:juniorz/mytestapp.git" | |
set :branch, 'master' | |
set :user, "deploy" # O usuário que eu criei | |
set :deploy_to, "/home/deploy/www/#{application}" # Faz o deploy nesse path | |
# Faz o deploy ser mais rápido, utilizando um repositório de cache (no servidor) | |
set :deploy_via, :remote_cache | |
# Por segurança. Não precisa usar sudo porque :deploy_to pode ser escrito por :user | |
set :use_sudo, false | |
#Outras opções | |
set :git_enable_submodules, 1 | |
set :scm_verbose, true | |
# if you're still using the script/reaper helper you will need | |
# these http://github.com/rails/irs_process_scripts | |
# If you are using Passenger mod_rails uncomment this: | |
namespace :deploy do | |
task :start do ; end | |
task :stop do ; end | |
task :restart, :roles => :app, :except => { :no_release => true } do | |
run "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