Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
Use capistrano for deploys
Browse files Browse the repository at this point in the history
  • Loading branch information
jsyeo committed Apr 28, 2015
1 parent 9d7dc04 commit 805c458
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
/config/initializers/devise.rb
/config/facebook.yml
/.idea/
/config/deploy.rb
/Capfile

/config/newrelic.yml

Expand All @@ -37,7 +35,6 @@
.ruby-version
.ruby-env

/config/database.yml
/config/puma.rb

# Ignore 1337 secrets
Expand Down
26 changes: 26 additions & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Load DSL and Setup Up Stages
require 'capistrano/setup'

# Includes default deployment tasks
require 'capistrano/deploy'

# Include bundler related tasks
require 'capistrano/bundler'

# Includes 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
#
require 'capistrano/rvm'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/puma'

# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ gem 'rollbar'
# Use unicorn as the app server
# gem 'unicorn'

#Deploy with Capistrano
# Deploy with Capistrano
gem 'capistrano'
gem 'capistrano-bundler'
gem 'capistrano-rvm'
gem 'capistrano-rails'
gem 'capistrano3-puma'

# To use debugger
# gem 'debugger'
16 changes: 16 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ GEM
i18n
rake (>= 10.0.0)
sshkit (~> 1.3)
capistrano-bundler (1.1.3)
capistrano (~> 3.1)
sshkit (~> 1.2)
capistrano-rails (1.1.3)
capistrano (~> 3.1)
capistrano-bundler (~> 1.1)
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
capistrano3-puma (0.9.0)
capistrano (~> 3.0)
puma (>= 2.6)
capybara (2.4.1)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
Expand Down Expand Up @@ -450,6 +462,10 @@ DEPENDENCIES
bootstrap-wysihtml5-rails!
cancancan (~> 1.8)
capistrano
capistrano-bundler
capistrano-rails
capistrano-rvm
capistrano3-puma
capybara
clockwork
cocoon
Expand Down
13 changes: 13 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
lock '3.2.1'

set :application, 'coursemology'

set :repo_url, '[email protected]:coursemology/coursemology.org.git'
set :branch, 'development'
set :deploy_via, :remote_cache

set :linked_dirs, ['log', 'tmp/cache', 'tmp/sockets', 'tmp/pids']

namespace :deploy do
after :finished, 'puma:restart'
end
6 changes: 6 additions & 0 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
user = 'raymoond'
hostname = 'coursemology.org'

server hostname, user: user, roles: %w{web app db}, primary: true

set :rails_env, 'production'

0 comments on commit 805c458

Please sign in to comment.