Skip to content

Instantly share code, notes, and snippets.

@ydkn
Last active August 29, 2015 14:25
Show Gist options
  • Save ydkn/c1e1baf334fb0af77733 to your computer and use it in GitHub Desktop.
Save ydkn/c1e1baf334fb0af77733 to your computer and use it in GitHub Desktop.
Capistrano, RVM, Bundler and capistrano-rails-console example configuration
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Includes tasks from other gems included in your Gemfile
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/rails/console'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
set :application, 'foo'
set :repo_url, 'git@foo:bar'
set :deploy_to, '/srv/foo'
set :keep_releases, 5
set :format, :pretty
set :log_level, :info
set :pty, true
set :linked_files, %w{config/database.yml config/sidekiq.yml}
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets}
namespace :deploy do
task :restart
end
group :development do
gem 'capistrano', require: false
gem 'capistrano-rvm', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano-rails', require: false
gem 'capistrano-rails-console', require: false
end
set :stage, :production
server 'foo.bar', user: 'appuser', roles: %w(web app db)
set :rails_env, 'production'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment