Skip to content

Commit

Permalink
Changes to deploy for DPUL on Figgy.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpendragon committed Dec 14, 2017
1 parent 6c2f37e commit 325d49c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 30 deletions.
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.0.0.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
Expand Down Expand Up @@ -51,6 +49,8 @@ group :development, :test do
gem 'capistrano-rails-console'
gem 'database_cleaner'
gem 'rails-controller-testing'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
end

group :development do
Expand Down Expand Up @@ -98,5 +98,4 @@ gem 'spotlight-resources-iiif', github: 'pulibrary/spotlight-resources-iiif', br
gem 'newrelic_rpm'
gem 'dalli'
gem 'ruby-prof', require: false
gem 'ddtrace'
gem 'honeybadger', '~> 2.0'
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ GEM
safe_yaml (~> 1.0.0)
dalli (2.7.6)
database_cleaner (1.5.3)
ddtrace (0.5.0)
msgpack
debug_inspector (0.0.2)
declarative (0.0.9)
declarative-option (0.1.0)
Expand Down Expand Up @@ -304,7 +302,6 @@ GEM
mini_portile2 (2.1.0)
minitest (5.10.1)
modernizr-rails (2.7.1)
msgpack (1.0.3)
multi_json (1.12.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
Expand Down Expand Up @@ -580,7 +577,6 @@ DEPENDENCIES
coveralls
dalli
database_cleaner
ddtrace
devise
devise-guests (~> 0.3)
devise_invitable
Expand Down
6 changes: 3 additions & 3 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@
namespace :sneakers do
task :restart do
on roles(:worker) do
execute :sudo, :initctl, :restart, "pom-sneakers"
execute :sudo, :service, "dpul-sneakers", :restart
end
end
end
namespace :sidekiq do
task :quiet do
on roles(:worker) do
# Horrible hack to get PID without having to use terrible PID files
puts capture("kill -USR1 $(sudo initctl status pom-workers | grep /running | awk '{print $NF}') || :")
puts capture("kill -USR1 $(sudo initctl status sidekiq-workers | grep /running | awk '{print $NF}') || :")
end
end
task :restart do
on roles(:worker) do
execute :sudo, :initctl, :restart, "pom-workers"
execute :sudo, :service, "sidekiq-workers", :restart
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
# server 'db.example.com', user: 'deploy', roles: %w{db}
server 'lib-pom1', user: 'deploy', roles: %w(app db web worker)
set :deploy_to, '/opt/rails_app'
server 'dpul1', user: 'deploy', roles: %w(app db web worker)
set :deploy_to, '/opt/dpul'

# role-based syntax
# ==================
Expand Down
36 changes: 18 additions & 18 deletions config/initializers/datadog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
require 'redis'

if Rails.env.staging? || Rails.env.production?
require 'sidekiq'
require 'ddtrace'
require 'ddtrace/contrib/sidekiq/tracer'
Rails.configuration.datadog_trace = {
auto_instrument: true,
auto_instrument_redis: true,
default_service: "Plum (#{Rails.env})"
}

Sidekiq.configure_server do |config|
config.server_middleware do |chain|
chain.add(
Datadog::Contrib::Sidekiq::Tracer,
sidekiq_service: 'sidekiq'
)
end
end
Datadog::Monkey.patch_all
# require 'sidekiq'
# require 'ddtrace'
# require 'ddtrace/contrib/sidekiq/tracer'
# Rails.configuration.datadog_trace = {
# auto_instrument: true,
# auto_instrument_redis: true,
# default_service: "Plum (#{Rails.env})"
# }
#
# Sidekiq.configure_server do |config|
# config.server_middleware do |chain|
# chain.add(
# Datadog::Contrib::Sidekiq::Tracer,
# sidekiq_service: 'sidekiq'
# )
# end
# end
# Datadog::Monkey.patch_all
end

0 comments on commit 325d49c

Please sign in to comment.