Created
January 11, 2012 11:41
-
-
Save leandrocp/1594294 to your computer and use it in GitHub Desktop.
Capistrano deploy
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
require 'bundler/capistrano' | |
load 'deploy/assets' | |
# ENV | |
#----------------------------------------------------------------------------------------------- | |
set :default_environment, {'PATH' => '~/.rbenv/bin:~/.rbenv/shims:$PATH'} | |
#set :bundle_flags, '--deployment --quiet --binstubs --shebang ruby-local-exec' | |
# APP | |
#----------------------------------------------------------------------------------------------- | |
set :application, 'app' | |
# SERVERS | |
#----------------------------------------------------------------------------------------------- | |
#role :web, application | |
#role :app, application | |
#role :db, application, :primary => true | |
server "server.com.br", :app, :web, :db, :primary => true | |
# USER | |
#----------------------------------------------------------------------------------------------- | |
set :user, 'devop' | |
set :runner, 'devop' | |
set :scm_username, 'devop' | |
set :use_sudo, false | |
# PATH | |
#----------------------------------------------------------------------------------------------- | |
set :deploy_to, "/var/apps/#{application}" | |
set :deploy_via, :remote_cache | |
# GIT | |
#----------------------------------------------------------------------------------------------- | |
set :scm, :git | |
set :repository, 'file:///var/local/git/repo.gi' | |
set :local_repository, 'ssh://user@server.com.br/var/local/git/repo.git' | |
set :branch, 'master' | |
set :keep_releases, 1 | |
# DATABASE CONFIG | |
#----------------------------------------------------------------------------------------------- | |
after 'deploy:update_code', 'deploy:symlink_db' | |
namespace :deploy do | |
desc "Symlinks the database.yml" | |
task :symlink_db, :roles => :app do | |
run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment