Skip to content

Commit

Permalink
capistrano implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
ndushay committed Apr 7, 2016
1 parent 310d1ec commit 3f99ce6
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Load DSL and set up stages
require 'capistrano/setup'

# Include default deployment tasks
require 'capistrano/deploy'

# Include 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
# https://github.com/capistrano/passenger
#
# require 'capistrano/rvm'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
require 'dlss/capistrano'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'
# require 'capistrano/passenger'

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
#Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ group :development, :test do
gem 'rspec'
# gem 'rspec-expectations'
end

group :deployment do
gem 'capistrano', '~> 3.0'
gem 'capistrano-bundler'
gem 'dlss-capistrano'
end
35 changes: 35 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,47 @@ GEM
remote: https://rubygems.org/
specs:
ast (2.2.0)
bundler-audit (0.5.0)
bundler (~> 1.2)
thor (~> 0.18)
capistrano (3.4.0)
i18n
rake (>= 10.0.0)
sshkit (~> 1.3)
capistrano-bundle_audit (0.0.5)
bundler-audit
capistrano (~> 3.0)
capistrano-bundler (1.1.4)
capistrano (~> 3.1)
sshkit (~> 1.2)
capistrano-one_time_key (0.0.1)
capistrano (~> 3.0)
capistrano-releaseboard (0.0.1)
faraday
coveralls (0.8.13)
json (~> 1.8)
simplecov (~> 0.11.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (~> 1.6.0)
diff-lcs (1.2.5)
dlss-capistrano (3.2.0)
capistrano (~> 3.0)
capistrano-bundle_audit (>= 0.0.3)
capistrano-one_time_key
capistrano-releaseboard
dlss_cops (0.0.3)
rubocop (~> 0.37.0)
rubocop-rspec (~> 1.4.0)
docile (1.1.5)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
i18n (0.7.0)
json (1.8.3)
multipart-post (2.0.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (3.1.1)
parser (2.3.0.7)
ast (~> 2.2)
powerpack (0.1.1)
Expand Down Expand Up @@ -45,6 +74,9 @@ GEM
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sshkit (1.9.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
term-ansicolor (1.3.2)
tins (~> 1.0)
thor (0.19.1)
Expand All @@ -55,7 +87,10 @@ PLATFORMS
ruby

DEPENDENCIES
capistrano (~> 3.0)
capistrano-bundler
coveralls
dlss-capistrano
dlss_cops
rake
rspec
Expand Down
35 changes: 35 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# config valid only for current version of Capistrano
lock '3.4.0'

set :application, 'rwj_reporting'
set :repo_url, 'https://github.com/sul-dlss/rwj_reporting.git'
set :user, 'media'

# Default branch is :master
ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp

# Default value for :log_level is :debug
set :log_level, :info

# Default value for :linked_files is []
set :linked_files, fetch(:linked_files, []).push('config/settings.yml')

# Default value for linked_dirs is []
# set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')

# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }

# Default value for keep_releases is 5
# set :keep_releases, 5

namespace :deploy do
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end
9 changes: 9 additions & 0 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set :home_directory, "/home/#{fetch(:user)}"
set :deploy_to, "#{fetch(:home_directory)}/#{fetch(:application)}"

# The only production server at the moment. A second will be added after the node is pupgraded
server 'libstream.stanford.edu', user: fetch(:user), roles: %w(app)

Capistrano::OneTimeKey.generate_one_time_key!

set :bundle_without, %w(development test).join(' ')

0 comments on commit 3f99ce6

Please sign in to comment.