Skip to content

Instantly share code, notes, and snippets.

@ruvaleev
Created June 26, 2020 08:47
Show Gist options
  • Save ruvaleev/a49a85cd0ff491d9fa3e04f35f2d12de to your computer and use it in GitHub Desktop.
Save ruvaleev/a49a85cd0ff491d9fa3e04f35f2d12de to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
# Load DSL and set up stages
require 'capistrano/setup'
# Include default deployment tasks
require 'capistrano/deploy'
# Load the SCM plugin appropriate to your project:
#
# require "capistrano/scm/hg"
# install_plugin Capistrano::SCM::Hg
# or
# require "capistrano/scm/svn"
# install_plugin Capistrano::SCM::Svn
# or
require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git
# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
# https://github.com/capistrano/rvm
# https://github.com/capistrano/rbenv
# https://github.com/capistrano/chruby
# https://github.com/capistrano/bundler
# https://github.com/capistrano/rails
# https://github.com/capistrano/passenger
#
# require "capistrano/rvm"
require 'capistrano/rbenv'
require 'capistrano/rails'
# require "capistrano/chruby"
require 'capistrano/bundler'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'
require "capistrano/passenger"
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
set :rbenv_type, :user
set :rbenv_ruby, '2.6.5'
# frozen_string_literal: true
# config valid for current version and patch releases of Capistrano
lock '~> 3.14.1'
set :application, 'project'
set :repo_url, 'git@github.com:ruvaleev/project_x.git'
# server 'boomboom.best', roles: %i[app]
# set :ssh_options, user: 'root'
# Default branch is :master
# set(:branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call)
# set(:branch, ENV['BRANCH']) if ENV['BRANCH']
# Default deploy_to directory is /var/www/my_app_name
set :deploy_to, "/home/deploy/#{fetch :application}"
set :deploy_user, 'deploy'
set :nginx_use_ssl, true
set :puma_init_active_record, true
set :bundle_jobs, 1
# Default value for :format is :airbrussh.
set :format, :pretty
set :log_level, :debug
# You can configure the Airbrussh format using :format_options.
# These are the defaults.
# set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto
# Default value for :pty is false
set :pty, true
# Default value for :linked_files is []
# append :linked_files, 'config/database.yml'
# set :linked_dirs, fetch(:linked_dirs, []) << '.bundle'
append :linked_dirs, '.bundle', 'vendor/bundle', 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system', 'public/uploads'
set :rbenv_type, :user
set :rbenv_ruby, '2.6.5'
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/shims/bundle exec" # rubocop:disable Layout/LineLength
# set :rbenv_map_bins, %w[rake gem bundle ruby rails]
set :rbenv_roles, :all # default value
# Default value for linked_dirs is []
# append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system"
# Default value for default_env is {}
set :default_env, rails_env: fetch(:stage, '$HOME/.rbenv')
# set :default_env, { path: "~/.rbenv/shims:~/.rbenv/bin:$PATH" }
# Default value for local_user is ENV['USER']
# set :local_user, -> { `git config user.name`.chomp }
# Default value for keep_releases is 5
set :keep_releases, 5
# Uncomment the following to require manually verifying the host key before first deploy.
# set :ssh_options, verify_host_key: :secure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment