Skip to content

Instantly share code, notes, and snippets.

@swalkinshaw
Last active November 5, 2019 01:59
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save swalkinshaw/7892821 to your computer and use it in GitHub Desktop.
Save swalkinshaw/7892821 to your computer and use it in GitHub Desktop.
# 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, 'roots.io'
set :repo_url, 'git@github.com:retlehs/roots.io.git'
set :branch, :master
set :deploy_to, '/srv/www/roots.io'
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'
end
end
end
before 'deploy:updated', 'grunt'
source 'https://rubygems.org'
gem 'capistrano', '~> 3.0.1'
gem 'capistrano-composer'
gem 'capistrano-npm'
gem 'capistrano-grunt'
set :stage, :production
server 'roots.io', user: 'deploy', roles: %w{web app db}
set :ssh_options, {
forward_agent: true
}
set :stage, :staging
server 'roots.dev', 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