Skip to content

Instantly share code, notes, and snippets.

@tvdeyen
Created November 3, 2016 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvdeyen/31e02dd224c35e35281cf097f65ed6c8 to your computer and use it in GitHub Desktop.
Save tvdeyen/31e02dd224c35e35281cf097f65ed6c8 to your computer and use it in GitHub Desktop.
AlchemyCMS deployment with Capistrano
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/alchemy'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
# config/deploy.rb
set :application, 'my-app'
set :repo_url, 'git@github.com:user/repo.git'
set :deploy_to, '/var/www/htdocs'
set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle')
source 'https://rubygems.org'
...
gem 'capistrano-alchemy', github: 'AlchemyCMS/capistrano-alchemy', branch: 'master', group: :development
...
# config/deploy/production.rb
server 'XX.XXX.XX.XXX', user: 'username', roles: %w{app db web}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment