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

Commit 805c458

Browse files
committed
Use capistrano for deploys
1 parent 9d7dc04 commit 805c458

File tree

6 files changed

+66
-4
lines changed

6 files changed

+66
-4
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
/config/initializers/devise.rb
2828
/config/facebook.yml
2929
/.idea/
30-
/config/deploy.rb
31-
/Capfile
3230

3331
/config/newrelic.yml
3432

@@ -37,7 +35,6 @@
3735
.ruby-version
3836
.ruby-env
3937

40-
/config/database.yml
4138
/config/puma.rb
4239

4340
# Ignore 1337 secrets

Capfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Load DSL and Setup Up Stages
2+
require 'capistrano/setup'
3+
4+
# Includes default deployment tasks
5+
require 'capistrano/deploy'
6+
7+
# Include bundler related tasks
8+
require 'capistrano/bundler'
9+
10+
# Includes tasks from other gems included in your Gemfile
11+
#
12+
# For documentation on these, see for example:
13+
#
14+
# https://github.com/capistrano/rvm
15+
# https://github.com/capistrano/rbenv
16+
# https://github.com/capistrano/chruby
17+
# https://github.com/capistrano/bundler
18+
# https://github.com/capistrano/rails
19+
#
20+
require 'capistrano/rvm'
21+
require 'capistrano/rails/assets'
22+
require 'capistrano/rails/migrations'
23+
require 'capistrano/puma'
24+
25+
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
26+
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

Gemfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ gem 'rollbar'
110110
# Use unicorn as the app server
111111
# gem 'unicorn'
112112

113-
#Deploy with Capistrano
113+
# Deploy with Capistrano
114114
gem 'capistrano'
115+
gem 'capistrano-bundler'
116+
gem 'capistrano-rvm'
117+
gem 'capistrano-rails'
118+
gem 'capistrano3-puma'
115119

116120
# To use debugger
117121
# gem 'debugger'

Gemfile.lock

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ GEM
100100
i18n
101101
rake (>= 10.0.0)
102102
sshkit (~> 1.3)
103+
capistrano-bundler (1.1.3)
104+
capistrano (~> 3.1)
105+
sshkit (~> 1.2)
106+
capistrano-rails (1.1.3)
107+
capistrano (~> 3.1)
108+
capistrano-bundler (~> 1.1)
109+
capistrano-rvm (0.1.2)
110+
capistrano (~> 3.0)
111+
sshkit (~> 1.2)
112+
capistrano3-puma (0.9.0)
113+
capistrano (~> 3.0)
114+
puma (>= 2.6)
103115
capybara (2.4.1)
104116
mime-types (>= 1.16)
105117
nokogiri (>= 1.3.3)
@@ -450,6 +462,10 @@ DEPENDENCIES
450462
bootstrap-wysihtml5-rails!
451463
cancancan (~> 1.8)
452464
capistrano
465+
capistrano-bundler
466+
capistrano-rails
467+
capistrano-rvm
468+
capistrano3-puma
453469
capybara
454470
clockwork
455471
cocoon

config/deploy.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
lock '3.2.1'
2+
3+
set :application, 'coursemology'
4+
5+
set :repo_url, '[email protected]:coursemology/coursemology.org.git'
6+
set :branch, 'development'
7+
set :deploy_via, :remote_cache
8+
9+
set :linked_dirs, ['log', 'tmp/cache', 'tmp/sockets', 'tmp/pids']
10+
11+
namespace :deploy do
12+
after :finished, 'puma:restart'
13+
end

config/deploy/production.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
user = 'raymoond'
2+
hostname = 'coursemology.org'
3+
4+
server hostname, user: user, roles: %w{web app db}, primary: true
5+
6+
set :rails_env, 'production'

0 commit comments

Comments
 (0)