2016-12-14 12 views
1

Я использую Капистранна для развертывания моего приложения рельсы, но я получаю следующее сообщение об ошибке:Capistrano-Sidekiq развернуть ошибку при перезапуске

Skipping task `sidekiq:restart'. 
Capistrano tasks may only be invoked once. Since task `sidekiq:restart' was previously invoked, invoke("sidekiq:restart") at config/deploy.rb:49 will be skipped. 
If you really meant to run this task again, first call Rake::Task["sidekiq:restart"].reenable 
THIS BEHAVIOR MAY CHANGE IN A FUTURE VERSION OF CAPISTRANO. Please join the conversation here if this affects you. 
https://github.com/capistrano/capistrano/issues/1686 

Кроме того, я думаю, что эта команда не работает даже в первый раз , так как sidekiq не работает. Я могу запустить его вручную, но я верю, что даже если он не работает, он должен начинаться в любом случае, не так ли?

Мой развернуть/production.rb:

# server-based syntax 
# ====================== 
# Defines a single server with a list of roles and multiple properties. 
# You can define all roles on a single server, or split them: 

set :stage, :production 
set :full_app_name, "#{fetch(:application)}_#{fetch(:stage)}" 

# Using remote cache to deploy 
set :deploy_via, :remote_cache 

server '35.160.22.104', user: 'ubuntu', roles: %w{app db web} 

# role-based syntax 
# ================== 

# Defines a role with one or multiple servers. The primary server in each 
# group is considered to be the first unless any hosts have the primary 
# property set. Specify the username and a domain or IP for the server. 
# Don't use `:all`, it's a meta role. 

# role :app, %w{[email protected]}, my_property: :my_value 
# role :web, %w{[email protected] [email protected]}, other_property: :other_value 
# role :db, %w{[email protected]} 



# Configuration 
# ============= 
# You can set any configuration variable like in config/deploy.rb 
# These variables are then only loaded and set in this stage. 
# For available Capistrano configuration variables see the documentation page. 
# http://capistranorb.com/documentation/getting-started/configuration/ 
# Feel free to add new variables to customise your setup. 
set :rails_env, :production 
set :pty, true 

# number of unicorn workers 
# set :unicorn_worker_count, 5 


# Custom SSH Options 
# ================== 
# You may pass any option but keep in mind that net/ssh understands a 
# limited set of options, consult the Net::SSH documentation. 
# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start 
# 
set :ssh_options, { 
    keys: %w(/home/ronanlopes/Pems/hybrazil-impulso.pem ~/.ssh/id_rsa), 
    forward_agent: true, 
    auth_methods: %w(publickey) 
} 


# Sidekiq 
set :sidekiq_config, File.join(current_path, 'config', 'sidekiq.yml') 
set :sidekiq_log, File.join(shared_path, 'log', 'sidekiq.log') 
set :sidekiq_pid, File.join(shared_path, 'tmp', 'pids', 'sidekiq.pid') 

Мой deploy.rb:

# config valid only for current version of Capistrano 
lock '3.7.0' 

set :application, 'hybrazil' 
set :repo_url, '[email protected]:fneto/hybrazil.git' 
set :user, 'ubuntu' 


# Need this so capistrano creates the directories as "ubuntu" user 
set :use_sudo, false 

# Default deploy_to directory is /var/www/my_app_name 
set :deploy_to, '/home/ubuntu/hybrazil' 

set :passenger_restart_with_touch, true 

set :rvm_type, :user 
set :rvm_ruby_version, '2.3.1' 

# Default value for :scm is :git 
# set :scm, :git 

# Default value for :format is :airbrussh. 
# set :format, :airbrussh 

# You can configure the Airbrussh format using :format_options. 
# These are the defaults. 
# set :format_options, command_output: true, log_file: 'log/capistrano.log', color: :auto, truncate: :auto 

# Default value for :pty is false 
# set :pty, true 

# Default value for :linked_files is [] 
# append :linked_files, 'config/database.yml', 'config/secrets.yml' 

# Default value for linked_dirs is [] 
# append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system' 

# Default value for default_env is {} 
# set :default_env, { path: "/opt/ruby/bin:$PATH" } 

set :linked_files, %w{config/database.yml config/secrets.yml} 
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads} 

namespace :deploy do 

    desc 'Restart application' 
    task :restart do 
    invoke 'sidekiq:restart' 
    on roles(:app), in: :sequence, wait: 5 do 
     execute :touch, release_path.join('tmp/restart.txt') 
    end 
    end 

end 

Любая помощь будет оценена. Благодаря!

+0

это не ошибка. это просто предупреждение –

ответ

0

Для меня установка pty в false работает. Все еще не знаю, почему, но если кто-то это сделает, он по достоинству оценит объяснение комментариев. Благодаря!