Sha256: 719a52dd4ad1e8caecb3d1bd3dc8adba7b719fe840617f6e66d6fd212c36869a
Contents?: true
Size: 1.04 KB
Versions: 2
Compression:
Stored size: 1.04 KB
Contents
require 'capistrano/nginx_unicorn/helpers' include Capistrano::NginxUnicorn::Helpers namespace :unicorn do desc "Setup Unicorn initializer" task :setup_initializer do on roles(:app) do template "unicorn_init.erb", "/tmp/unicorn_init" execute :chmod, "+x", "/tmp/unicorn_init" sudo :mv, "/tmp/unicorn_init /etc/init.d/#{fetch(:unicorn_service_name)}" sudo "update-rc.d -f #{fetch(:unicorn_service_name)} defaults" end end desc "Setup Unicorn app configuration" task :setup_app_config do on roles(:app) do execute :mkdir, "-p", shared_path.join("config") execute :mkdir, "-p", shared_path.join("log") execute :mkdir, "-p", shared_path.join("pids") template "unicorn.rb.erb", fetch(:unicorn_config) end end %w[start stop restart].each do |command| desc "#{command} unicorn" task command do on roles(:app) do sudo "service #{fetch(:unicorn_service_name)} #{command}" end end end end namespace :deploy do after :publishing, "unicorn:restart" end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
capistrano-nginx-unicorn-0.1.0 | lib/capistrano/tasks/unicorn.rake |
capistrano-nginx-unicorn-0.1.0.pre | lib/capistrano/tasks/unicorn.rake |