Sha256: 37928b0d1bd26e8bcd0979b207cf4c1a2908fa739f79942f0309f06bc678cbab
Contents?: true
Size: 1.08 KB
Versions: 9
Compression:
Stored size: 1.08 KB
Contents
Capistrano::Configuration.instance.load do require_settings :application, :current_path set_default(:unicorn_pid) { "#{current_path}/tmp/pids/unicorn.pid" } set_default(:unicorn_socket) { "#{current_path}/tmp/sockets/unicorn.sock" } set_default(:unicorn_log) { "#{current_path}/log/unicorn.log" } after "setup", "unicorn:setup" after "deploy:update_code", "unicorn:update_config" namespace :unicorn do desc "Setup a unicorn environment" task :setup, roles: :web, on_no_matching_servers: :continue do run "cd #{current_path}; mkdir -p tmp/pids tmp/sockets" end desc "Export the unicorn server configuration" task :update_config, roles: :web, on_no_matching_servers: :continue do upload_template "unicorn.rb", "#{current_path}/config/unicorn.rb" upload_template "unicorn_init.sh", "/tmp/unicorn_init" run "sudo chmod 700 /tmp/unicorn_init; sudo chown 0:0 /tmp/unicorn_init; sudo rm -f /etc/init.d/#{application}-web; sudo mv /tmp/unicorn_init /etc/init.d/#{application}-web; sudo update-rc.d -f #{application}-web defaults" end end end
Version data entries
9 entries across 9 versions & 1 rubygems