This commit is contained in:
f 2020-02-26 12:22:34 -03:00
parent 1c3c2a9a6d
commit 56e4d9145f
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
5 changed files with 33 additions and 6 deletions

View file

@ -11,6 +11,8 @@ doc:
./bin/yardoc --output-dir=./docs/ \ ./bin/yardoc --output-dir=./docs/ \
app/controllers/*.rb \ app/controllers/*.rb \
app/models/*.rb app/models/*.rb
chmod -R o=g docs/
rsync -av --delete-after docs/ lumi@partidopirata.com.ar:/srv/http/api.lumi.partidopirata.com.ar/deploy/shared/docs/
clean: clean:
rm -f log/*.log rm -f log/*.log

View file

@ -5,7 +5,7 @@ lock '~> 3.12.0'
set :application, 'lumi' set :application, 'lumi'
set :repo_url, 'https://0xacab.org/pip/miniloom/api.git' set :repo_url, 'https://0xacab.org/pip/miniloom/api.git'
set :deploy_to, '/srv/http/api.lumi.partidopirata.com.ar/deploy' set :deploy_to, '/srv/http/api.lumi.partidopirata.com.ar/deploy'
append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system', 'data', '.bundle' append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system', 'data', '.bundle', 'docs'
set :bundle_flags, '--deployment' set :bundle_flags, '--deployment'
set :bundle_jobs, 1 set :bundle_jobs, 1
set :bundle_env_variables, { nokogiri_use_system_libraries: 1 } set :bundle_env_variables, { nokogiri_use_system_libraries: 1 }
@ -14,5 +14,9 @@ set :ssh_options, verify_host_key: :always
set :default_env, { set :default_env, {
rails_env: 'production', rails_env: 'production',
rails_master_key: File.read('config/master.key') rails_master_key: File.read('config/master.key'),
web_concurrency: '1'
} }
after 'deploy:published', 'puma:stop'
after 'puma:stop', 'puma:start'

View file

@ -9,7 +9,7 @@
# server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value # server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value
# server "db.example.com", user: "deploy", roles: %w{db} # server "db.example.com", user: "deploy", roles: %w{db}
server 'partidopirata.com.ar', user: 'lumi', roles: %w[db web] server 'partidopirata.com.ar', user: 'lumi', roles: %w[db app web]
# role-based syntax # role-based syntax
# ================== # ==================

View file

@ -20,7 +20,7 @@ Rails.application.configure do
# Ensures that a master key has been made available in either # Ensures that a master key has been made available in either
# ENV["RAILS_MASTER_KEY"] or in config/master.key. This key is used to # ENV["RAILS_MASTER_KEY"] or in config/master.key. This key is used to
# decrypt credentials (and other encrypted files). # decrypt credentials (and other encrypted files).
# config.require_master_key = true config.require_master_key = true
# Disable serving static files from the `/public` folder by default # Disable serving static files from the `/public` folder by default
# since Apache or NGINX already handles this. # since Apache or NGINX already handles this.
@ -33,7 +33,7 @@ Rails.application.configure do
# Specifies the header that your server uses for sending files. # Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Store uploaded files on the local file system (see # Store uploaded files on the local file system (see
# config/storage.yml for options) # config/storage.yml for options)
@ -51,7 +51,7 @@ Rails.application.configure do
# Use the lowest log level to ensure availability of diagnostic # Use the lowest log level to ensure availability of diagnostic
# information when problems arise. # information when problems arise.
config.log_level = :debug config.log_level = :info
# Prepend all log lines with the following tags. # Prepend all log lines with the following tags.
config.log_tags = [:request_id] config.log_tags = [:request_id]

View file

@ -0,0 +1,21 @@
# frozen_string_literal: true
namespace :pumo do
desc 'Start puma'
task :start do
on roles(:web) do
within current_path do
execute :bundle, :exec, :puma, '--daemon'
end
end
end
desc 'Stop puma'
task :stop do
on roles(:web) do
within current_path do
execute "cat #{current_path}/tmp/puma.pid | xargs kill"
end
end
end
end