我正在尝试使用上限执行一些美洲狮行动,它什么也没做。
例如:
cap production puma:config
这是我的deploy.rb:
lock '3.10.1'
set :application, 'AppName'
set :repo_url, '########@git.......' # Edit this to match your repository
set :branch, ENV['BRANCH'] if ENV['BRANCH']
set :user, 'root'
set :deploy_to, '/home/root/AppName'
set :pty, true
#set :linked_files, %w{config/application.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads}
set :keep_releases, 5
set :rbenv_ruby, '2.4.1'
set :puma_rackup, -> { File.join(current_path, 'config.ru') }
set :puma_state, "#{shared_path}/tmp/pids/puma.state"
set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
set :puma_bind, "unix://#{shared_path}/tmp/sockets/puma.sock" #accept array for multi-bind
set :puma_conf, "/home/root/GlucoMeDDC/current/config/puma.rb"
set :puma_access_log, "#{shared_path}/log/puma_error.log"
set :puma_error_log, "#{shared_path}/log/puma_access.log"
set :puma_role, :app
set :puma_env, fetch(:rack_env, fetch(:rails_env, 'production'))
set :puma_threads, [1, 1]
set :puma_workers, 3
set :puma_worker_timeout, nil
set :puma_init_active_record, true
set :puma_preload_app, true
## Defaults:
# set :scm, :git
# set :branch, :master
# set :format, :pretty
# set :log_level, :debug
# set :keep_releases, 5
## Linked Files & Directories (Default None):
# set :linked_files, %w{config/database.yml}
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
namespace :puma do
desc 'Create Directories for Puma Pids and Socket'
task :make_dirs do
on roles(:app) do
execute "mkdir #{shared_path}/tmp/sockets -p"
execute "mkdir #{shared_path}/tmp/pids -p"
end
end
before :start, :make_dirs
end
namespace :deploy do
desc 'Initial Deploy'
task :initial do
on roles(:app) do
before 'deploy:restart', 'puma:start'
invoke 'deploy'
end
end
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
invoke! 'puma:restart'
end
end
after :finishing, :compile_assets
after :finishing, :cleanup
after :finishing, :restart
end
# ps aux | grep puma # Get puma pid
# kill -s SIGUSR2 pid # Restart puma
# kill -s SIGTERM pid # Stop puma
Capfile:
# Load DSL and set up stages
include SSHKit::DSL
require "capistrano/setup"
require "capistrano/deploy"
require 'capistrano/puma'
install_plugin Capistrano::Puma
install_plugin Capistrano::Puma::Workers
require 'sshkit'
require 'sshkit/dsl'
require 'capistrano/bundler'
require 'capistrano/rails/assets' # for asset handling add
require 'capistrano/rails/migrations' # for running migrations
# require 'capistrano/rbenv'
require 'capistrano/ssh_doctor'
require 'capistrano/yarn'
# Include default deployment tasks
# Load the SCM plugin appropriate to your project:
#
# require "capistrano/scm/hg"
# install_plugin Capistrano::SCM::Hg
# or
# require "capistrano/scm/svn"
# install_plugin Capistrano::SCM::Svn
# or
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
require "capistrano/scm/git-with-submodules"
install_plugin Capistrano::SCM::Git::WithSubmodules
# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
# https://github.com/capistrano/rvm
# https://github.com/capistrano/rbenv
# https://github.com/capistrano/chruby
# https://github.com/capistrano/bundler
# https://github.com/capistrano/rails
# https://github.com/capistrano/passenger
#
# require "capistrano/rvm"
# require "capistrano/rbenv"
# require "capistrano/chruby"
# require "capistrano/bundler"
# require "capistrano/rails/assets"
# require "capistrano/rails/migrations"
# require "capistrano/passenger"
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
不返回任何内容,只返回空行。
Capistrano.log:
INFO ---------------------------------------------------------------------------
INFO START 2018-01-18 16:30:55 +0200 cap production puma:config
INFO ---------------------------------------------------------------------------
任务列表:
cap puma:config # Setup Puma config file
cap puma:halt # halt puma
cap puma:make_dirs # Create Directories for Puma Pids and Socket
cap puma:phased-restart # phased-restart puma
cap puma:restart # restart puma
cap puma:start # Start puma
cap puma:status # status puma
cap puma:stop # stop puma
cap puma:workers:count # Add a worker
cap puma:workers:less # Worker--
cap puma:workers:more # Worker++
请建议。
谢谢!