Commit ea5ba2e
Changed files (3)
config
config/deploy.rb
@@ -3,34 +3,21 @@ lock "3.4.0"
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
set :application, "stronglifters"
-#set :repo_url, "git@github.com:stronglifters/surface.git"
-#set :branch, "master"
-
-# Default branch is :master
-# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
-
-# Default deploy_to directory is /var/www/my_app_name
-# set :deploy_to, "/var/www/my_app_name"
-
-# Default value for :scm is :git
-# set :scm, :git
+set :deploy_to, "/var/www/stronglifters"
set :scm, :s3
set :bucket_name, "stronglifters"
-
-# Default value for :format is :pretty
-# set :format, :pretty
-
-# Default value for :log_level is :debug
+set :format, :pretty
set :log_level, :warn
+set :keep_releases, 5
# Default value for :pty is false
# set :pty, true
# Default value for :linked_files is []
-set :linked_files, fetch(:linked_files, []).push(
- "config/database.yml",
- ".env.#{fetch(:rails_env, 'production')}",
-)
+#set :linked_files, fetch(:linked_files, []).push(
+ #"config/database.yml",
+ #".env.#{fetch(:rails_env, 'production')}",
+#)
# Default value for linked_dirs is []
set :linked_dirs, fetch(:linked_dirs, []).push(
@@ -45,9 +32,6 @@ set :linked_dirs, fetch(:linked_dirs, []).push(
# 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
-
if File.exist?("config/deploy_id_rsa")
set :ssh_options, keys: ["config/deploy_id_rsa"], forward_agent: true
else
@@ -59,8 +43,10 @@ set :rbenv_ruby, "2.2.3"
namespace :deploy do
task :restart do
on roles(:web), in: :groups, limit: 3, wait: 10 do
- execute :service, "puma restart"
- #execute :sv, "reload puma"
+ sudo :sv, "reload puma"
+ end
+ on roles(:app), in: :groups, limit: 3, wait: 10 do
+ sudo :sv, "reload sidekiq"
end
end
config/puma.rb
@@ -12,4 +12,4 @@ on_worker_boot do
# Worker specific setup for Rails 4.1+
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
ActiveRecord::Base.establish_connection
-end
\ No newline at end of file
+end
config/puma_production.rb
@@ -1,18 +1,13 @@
-# Change to match your CPU core count
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
-
-# Min and Max threads per worker
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count
rails_root = File.expand_path("../..", __FILE__)
-# Default to production
-rails_env = ENV['RAILS_ENV'] || "production"
-environment rails_env
+environment ENV['RAILS_ENV'] || "production"
-# Set up socket location
bind "unix:#{rails_root}/tmp/sockets/puma.sock"
+bind "tcp://127.0.0.1:9292"
# Set master PID and state locations
pidfile "#{rails_root}/tmp/pids/puma.pid"
@@ -22,5 +17,5 @@ activate_control_app
on_worker_boot do
require "active_record"
ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
- ActiveRecord::Base.establish_connection(YAML.load_file("#{rails_root}/config/database.yml")[rails_env])
+ ActiveRecord::Base.establish_connection
end