tablexi/capistrano3-unicorn
关于
This is a capistrano v3 plugin that integrates Unicorn tasks into capistrano deployment scripts; it was heavily inspired by sosedoff/capistrano-unicorn but written from scratch to use the capistrano 3 syntax.
系统与基础设施实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Capistrano3 Unicorn
This is a capistrano v3 plugin that integrates Unicorn tasks into capistrano deployment scripts; it was heavily inspired by sosedoff/capistrano-unicorn but written from scratch to use the capistrano 3 syntax.
Gotchas
The
unicorn:starttask invokes unicorn asbundle exec unicornby default.When running tasks not during a full deployment, you may need to run the
rvm:hook:cap production rvm:hook unicorn:start
Conventions
You can override the defaults by set :unicorn_example, value in the config/deploy.rb or config/deploy/ENVIRONMENT.rb capistrano deployment files.
Example Unicorn config examples/unicorn.rb
:unicorn_execDefault assumes using 'unicorn'. 'unicorn_rails' may be used instead.
:unicorn_pidDefault assumes your pid file will be located in
CURRENT_PATH/tmp/pids/unicorn.pid. The unicorn_pid should be defined with an absolute path.:unicorn_config_pathDefault assumes that your Unicorn configuration will be located in
CURRENT_PATH/config/unicorn/RAILS_ENV.rb:unicorn_rolesRoles to run unicorn commands on. Defaults to :app
:unicorn_optionsSet any additional options to be passed to unicorn on startup. Defaults to none
:unicorn_rack_envSet the RACK_ENV. Defaults to deployment unless the RAILS_ENV is development. Valid options are "development", "deployment", or "none". See the RACK ENVIRONMENT section of the unicorn documentation for more information.
:unicorn_bundle_gemfileREMOVED in v0.2.0
Set the BUNDLE_GEMFILE in a before_exec block in your unicorn.rb. See sandbox and unicorn-restart-issue-with-capistrano
:unicorn_restart_sleep_timeIn
unicorn:legacy_restartsend the USR2 signal, sleep for this many seconds (defaults to 3), then send the QUIT signal
Setup
Add the library to your Gemfile:
group :development do
gem 'capistrano3-unicorn'
end
Add the library to your Capfile:
require 'capistrano3/unicorn'
Invoke Unicorn from your config/deploy.rb or config/deploy/ENVIRONMENT.rb:
If preload_app:true use:
after 'deploy:publishing', 'deploy:restart'
namespace :deploy do
task :restart do
invoke 'unicorn:restart'
end
end
If preload_app:true and you need capistrano to cleanup your oldbin pid use:
after 'deploy:publishing', 'deploy:restart'
namespace :deploy do
task :restart do
invoke 'unicorn:legacy_restart'
end
end
Otherwise use:
after 'deploy:publishing', 'deploy:restart'
namespace :deploy do
task :restart do
invoke 'unicorn:reload'
end
end
Note that presently you must put the invoke outside any on block since the task handles this for you; otherwise you will get an undefined method 'verbosity' error.
Ensure that your unicorn_pid directory has been added Capistrano's linked_dirs. Otherwise unicorn workers will not be properly killed/restarted.
探索相关项目
加载中…