Skip to content

Instantly share code, notes, and snippets.

@sigra
sigra / deploy.rb
Last active May 1, 2017 12:54 — forked from trushkevich/deploy.rb
private_pub Capistrano 3 with Thin on Unix socket
set :private_pub_pid, -> { "#{current_path}/tmp/pids/private_pub.pid" }
set :private_pub_socket, -> { "#{current_path}/tmp/sockets/private_pub.sock" }
set :private_pub_rackup, -> { "#{current_path}/private_pub.ru" }
namespace :private_pub do
desc "Start private_pub server"
task :start do
on roles(:app) do
within release_path do
with rails_env: fetch(:stage) do
Hotspot::Page.where(page_type: 'Advertising').find_each do |row|
button_type = case row.redirect_text
when nil, '' then 'full_screen'
when 'верх' then 'top_screen'
when 'центр' then 'middle_screen'
when 'низ' then 'bottom_screen'
else 'button_screen'
end
row.update_columns(redirect_text: '', button_type: button_type)