This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def template(from, to, options = {}) | |
template_path = File.expand_path("../../templates/#{from}", __FILE__) | |
template = ERB.new(File.new(template_path).read).result(binding) | |
upload! StringIO.new(template), to, mode: 0644 # Otherwise it's set to 0640, which is not readable by other users (https://github.com/net-ssh/net-scp/blob/master/lib/net/scp/upload.rb#L63) | |
sudo "chown root:root #{to}" if options[:as_root] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node.default["postgresql"]["config"]["wal_level"] = "replica" | |
node.default["postgresql"]["config"]["max_wal_senders"] = 6 | |
node.default["postgresql"]["config"]["wal_keep_segments"] = 120 | |
node.default["postgresql"]["config"]["hot_standby"] = "on" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ $ curl -vv https://www.agendrix.com/wp-content/themes/agendrix/style.min.css\?ver\=1486665895 | |
* Trying 162.216.18.169... | |
* TCP_NODELAY set | |
* Connected to www.agendrix.com (162.216.18.169) port 443 (#0) | |
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 | |
* Server certificate: *.agendrix.com | |
* Server certificate: COMODO RSA Domain Validation Secure Server CA | |
* Server certificate: COMODO RSA Certification Authority | |
> GET /wp-content/themes/agendrix/style.min.css?ver=1486665895 HTTP/1.1 | |
> Host: www.agendrix.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV['RAILS_ENV'] = 'production' | |
web_path = '/home/deployer/apps/web/current' | |
Bluepill.application('web', :log_file => "#{web_path}/log/bluepill.log") do |app| | |
app.process('unicorn') do |process| | |
process.pid_file = "#{web_path}/tmp/pids/unicorn.pid" | |
process.working_dir = web_path | |
process.start_command = "/usr/local/bin/bundle exec unicorn -D -c #{web_path}/config/unicorn.rb -E #{ENV['RAILS_ENV']}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :load do | |
task :defaults do | |
set :puma_init_name, "#{fetch(:application)}-web" | |
set :puma_pid_path, "#{shared_path}/tmp/pids/puma.pid" | |
end | |
end | |
namespace :puma do | |
desc "Start puma workers" | |
task :start do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start on runlevel [2345] | |
stop on runlevel [06] | |
setuid deployer | |
setgid sysadmin | |
respawn | |
respawn limit 3 30 | |
script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def template(from, to) | |
template_path = File.expand_path("../templates/#{from}", __FILE__) | |
template = ERB.new(File.new(template_path).read).result(binding) | |
upload! StringIO.new(template), to | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Encoding: UTF-8 | |
SIG_REGEX = /(--|__|\w-$)|(^(\w+\s*){1,3} #{"Sent from my".reverse}$)|(^(\w+\s*){1,3} #{"Envoyé de mon".reverse}$)/n | |
has a non escaped non ASCII character in non ASCII-8BIT script (RegexpError) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PgSearch.multisearch_options = { | |
:using => { tsearch: { prefix: true } } | |
} | |
module PgSearch | |
class Document < ActiveRecord::Base | |
before_save do | |
self.organization_id = searchable.organization_id | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rake/testtask' | |
Rake::TestTask.new('test:models' => ['db:test:prepare', 'db:seed']) do |t| | |
t.pattern = 'test/models/**/*_test.rb' | |
end | |
Rake::TestTask.new('test:controllers' => ['db:test:prepare', 'db:seed']) do |t| | |
t.pattern = 'test/controllers/**/*_test.rb' | |
end |
NewerOlder