Skip to content

Instantly share code, notes, and snippets.

Last active November 5, 2019 01:59
What would you like to do?
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Custom tasks
require 'capistrano/composer'
require 'capistrano/npm'
require 'capistrano/grunt'
set :application, ''
set :repo_url, ''
set :branch, :master
set :deploy_to, '/srv/www/'
set :log_level, :info
set :pty, true
set :linked_dirs, %w{media}
set :linked_files, %w{.env}
set :theme_path, "#{release_path}/app/themes/roots"
set :npm_target_path, fetch(:theme_path)
set :grunt_target_path, fetch(:theme_path)
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app) do
sudo 'service', 'nginx', 'reload'
before 'deploy:updated', 'grunt'
source ''
gem 'capistrano', '~> 3.0.1'
gem 'capistrano-composer'
gem 'capistrano-npm'
gem 'capistrano-grunt'
set :stage, :production
server '', user: 'deploy', roles: %w{web app db}
set :ssh_options, {
forward_agent: true
set :stage, :staging
server '', user: 'vagrant', roles: %w{web app db}
# Vagrant specific
set :ssh_options, {
keys: %w(~/.vagrant.d/insecure_private_key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment