Skip to content

Instantly share code, notes, and snippets.

@328
Last active September 3, 2016 12:35
Show Gist options
  • Save 328/9670de0ff4dc15d3495822a21fd59e8f to your computer and use it in GitHub Desktop.
Save 328/9670de0ff4dc15d3495822a21fd59e8f to your computer and use it in GitHub Desktop.
Capistrano3 プラクティス
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rails'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/rbenv'
require 'capistrano/bundler'
require 'capistrano/locally'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
lock '3.6.1'
set :application, 'hogehoge'
set :repo_url, '[email protected]:328/hogehoge.git'
set :branch, 'master'
set :deploy_to, "/home/rails/hogehoge"
set :scm, :git
set :format, :pretty
set :log_level, :debug
set :keep_releases, 3
set :rbenv_type, :user
set :rbenv_ruby, '2.2.4'
set :rbenv_path, '/usr/local/rbenv'
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
set :rbenv_map_bins, %w{rake gem bundle ruby rails}
set :rbenv_roles, :all # default value
set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{bin bundle log tmp/pids tmp/cache tmp/sockets public/system}
set :stage, :production
set :bundle_path, -> { shared_path.join('./vendor/bundle') }
server 'localhost', user: 'rails', roles: %{web}
server 'localhost', user: 'rails', roles: %{app db}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment