1
我有一個使用sidekiq的rails 4.2應用程序。我正在使用mina進行部署。我的Gemfile包含'sidekiq'和'mina-sidekiq'。sidekiq不以mina部署rails 4應用程序開始。
我的部署腳本是
require 'mina_sidekiq/tasks'
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm' # for rvm support. (http://rvm.io)
set :domain, 'x.x.x.x'
set :deploy_to, '/home/deploy/appname'
set :repository, '[email protected]:username/appname.git'
#set :identity_file, "#{ENV['HOME']}/.ssh/id_rsa"
set :branch, 'master'
set :rails_env, 'production'
set :shared_paths, ['config/secrets.yml', 'log', 'tmp']
set :user, 'deploy'
task :environment do
invoke :'rvm:use[[email protected]]'
end
task :setup => :environment do
queue! %[mkdir -p "#{deploy_to}/#{shared_path}/log"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/log"]
queue! %[mkdir -p "#{deploy_to}/#{shared_path}/config"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/config"]
queue! %[mkdir -p "#{deploy_to}/#{shared_path}/tmp"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/tmp"]
queue! %[mkdir -p "#{deploy_to}/#{shared_path}/tmp/pids"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/tmp/pids"]
queue! %[touch "#{deploy_to}/#{shared_path}/config/secrets.yml"]
queue %[echo "-----> Be sure to edit '#{deploy_to}/#{shared_path}/config/secrets.yml'."]
end
desc "Deploys the current version to the server."
task :deploy => :environment do
to :before_hook do
# Put things to run locally before ssh
end
deploy do
# Put things that will set up an empty directory into a fully set-up
# instance of your project.
invoke :'sidekiq:quiet'
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
invoke :'rails:assets_precompile'
invoke :'deploy:cleanup'
to :launch do
queue "mkdir -p #{deploy_to}/#{current_path}/tmp/"
queue "touch #{deploy_to}/#{current_path}/tmp/restart.txt"
invoke :'sidekiq:restart'
end
end
end
配置/ sidekiq.yml包含
# Sample configuration file for Sidekiq.
# # Options here can still be overridden by cmd line args.
# # sidekiq -C config.yml
# ---
:verbose: false
:concurrency: 1
:queues:
- [often, 7]
- [default, 5]
- [seldom, 3]
過去的幾年中含有的 '米娜部署--verbose' 如
-----> Build finished
-----> Moving build to releases/37
$ mv "$build_path" "$release_path"
-----> Updating the current symlink
$ ln -nfs "$release_path" "current"
-----> Launching
$ cd "$release_path"
-----> Stop sidekiq
Skip stopping sidekiq (no pid file found)
-----> Start sidekiq
$ bundle exec sidekiq -d -e production -C /home/deploy/appname/current/config/sidekiq.yml -i 0 -P /home/deploy/appname/shared/pids/sideki
$ bundle exec sidekiq -d -e production -C /home/deploy/appname/current/config/sidekiq.yml -i 0 -P /home/deploy/appname/shared/pids/sidekiq.pid -L /home/deploy/appname/current/log/sidekiq.log
-----> Done. Deployed v37
問題是部署後,sidekiq進程仍未在服務器上運行。有什麼建議麼?