@@ -3,18 +3,23 @@ staging:
|
||||
ssh_port: 21
|
||||
server: staging.participacion.madrid.es
|
||||
user: xxxxx
|
||||
full_app_name: participacion
|
||||
server_name: staging.participacion.madrid.es
|
||||
db_server: postgre.participacion.madrid.es
|
||||
|
||||
preproduction:
|
||||
deploy_to: "/var/www/participacion"
|
||||
ssh_port: 2222
|
||||
server: xxx.xxx.xxx.xxx
|
||||
server1: xxx.xxx.xxx.xxx
|
||||
server2: xxx.xxx.xxx.xxx
|
||||
user: xxxxx
|
||||
full_app_name: participacion
|
||||
db_server: xxx.xxx.xxx.xxx
|
||||
|
||||
production:
|
||||
deploy_to: "/var/www/participacion"
|
||||
ssh_port: 2222
|
||||
server: xxx.xxx.xxx.xxx
|
||||
user: xxxxx
|
||||
full_app_name: participacion
|
||||
|
||||
|
||||
@@ -6,11 +6,14 @@ def deploysecret(key)
|
||||
@deploy_secrets_yml[key.to_s]
|
||||
end
|
||||
|
||||
|
||||
set :rails_env, fetch(:stage)
|
||||
set :rvm_ruby_version, '2.2.2'
|
||||
set :rvm_type, :user
|
||||
|
||||
set :application, 'participacion'
|
||||
set :full_app_name, deploysecret(:full_app_name)
|
||||
|
||||
set :server_name, deploysecret(:server_name)
|
||||
#set :repo_url, 'git@github.com:AyuntamientoMadrid/participacion.git'
|
||||
# If ssh access is restricted, probably you need to use https access
|
||||
|
||||
@@ -6,4 +6,5 @@ set :ssh_options, port: deploysecret(:ssh_port)
|
||||
set :stage, :production
|
||||
set :rails_env, :production
|
||||
|
||||
server deploysecret(:server), user: deploysecret(:user), roles: %w(web app db importer)
|
||||
server deploysecret(:server1), user: deploysecret(:user), roles: %w(web app db importer)
|
||||
server deploysecret(:server2), user: deploysecret(:user), roles: %w(web app db importer)
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
def deploysecret(key)
|
||||
@deploy_secrets_yml ||= YAML.load_file('config/deploy-secrets.yml')['production']
|
||||
@deploy_secrets_yml[key.to_s]
|
||||
end
|
||||
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
@@ -42,7 +47,7 @@ Rails.application.configure do
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||
# config.force_ssl = true
|
||||
config.force_ssl = true
|
||||
|
||||
# Use the lowest log level to ensure availability of diagnostic information
|
||||
# when problems arise.
|
||||
@@ -62,7 +67,8 @@ Rails.application.configure do
|
||||
|
||||
# Ignore bad email addresses and do not raise email delivery errors.
|
||||
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||
# config.action_mailer.raise_delivery_errors = false
|
||||
config.action_mailer.raise_delivery_errors = true
|
||||
config.action_mailer.default_url_options = { host: deploysecret(:server_name) }
|
||||
|
||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||
# the I18n.default_locale when a translation cannot be found).
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
def deploysecret(key)
|
||||
@deploy_secrets_yml ||= YAML.load_file('config/deploy-secrets.yml')['staging']
|
||||
@deploy_secrets_yml[key.to_s]
|
||||
end
|
||||
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
@@ -42,7 +47,7 @@ Rails.application.configure do
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||
# config.force_ssl = true
|
||||
config.force_ssl = true
|
||||
|
||||
# Use the lowest log level to ensure availability of diagnostic information
|
||||
# when problems arise.
|
||||
@@ -62,7 +67,8 @@ Rails.application.configure do
|
||||
|
||||
# Ignore bad email addresses and do not raise email delivery errors.
|
||||
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||
# config.action_mailer.raise_delivery_errors = false
|
||||
config.action_mailer.raise_delivery_errors = true
|
||||
config.action_mailer.default_url_options = { host: deploysecret(:server_name) }
|
||||
|
||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||
# the I18n.default_locale when a translation cannot be found).
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace :deploy do
|
||||
%w(start stop force-stop restart upgrade reopen-logs).each do |command|
|
||||
task command.to_sym do
|
||||
on roles(:app), in: :sequence, wait: 5 do
|
||||
sudo "/etc/init.d/unicorn_#{fetch(:full_app_name)} #{command}"
|
||||
execute "/etc/init.d/unicorn_#{fetch(:full_app_name)} #{command}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user