Mina部署失败

时间:2016-01-27 13:42:47

标签: ruby-on-rails deployment mina

我尝试通过mina部署rails app。但是当我开始部署任务时,mina返回错误

-----> Launching
       $ cd "$release_path"
       $  echo "$release_path" 
       $ 
               if [ -e '/home/ubuntu/deploy/shared/tmp/sockets/pumactl.sock' ]; then
                 cd /home/ubuntu/deploy/current && RAILS_ENV="production" /home/ubuntu/.rbenv/shims/bundle exec pumactl -S /home/ubuntu/deplo                 cd /home/ubuntu/deploy/current && RAILS_ENV="production" /home/ubuntu/.rbenv/shims/bundle exec pumactl -S /home/ubuntu/deploy/shared/tmp/sockets/puma.state phased-restart
               else
                 echo 'Puma is not running!';
               fi

       Could not locate Gemfile or .bundle/ directory
 !     ERROR: Deploy failed.

我在deploy.rb中的任务传递得很好,但是当mina开始启动时 - 我收到错误。这是我的deploy_staging.rb

require 'mina/bundler'
require 'mina/rails'
require 'mina/whenever'
require 'mina/git'
require 'mina/rbenv'
require 'mina/puma'
require 'mina/nginx'
require 'mina/scp'
node_path    = '/usr/bin/node'

set :domain,      ''
set :application, 'deploy'
set :server_name, ''
set :deploy_to,   '/home/ubuntu/deploy'
set :repository,  ''
set :branch,      'master'
set :bundle_bin, '/home/ubuntu/.rbenv/shims/bundle'



desc "Restart Resque workers"
task :restart_resque => :environment do
  queue! %(RAILS_ENV=production rake resque:restart_workers)
end

desc "Precompiles assets."
task :'assets_precompile:force' do
  queue %{
      echo "-----> Precompiling asset files"
      #{echo_cmd %[#{rake_assets_precompile}]}
    }
end


task :enviroment do
  invoke :'rbenv:load'
  queue! %(export NODE_PATH="#{node_path}")
  queue! %(export PATH="#{node_path}:$PATH")
  queue! %[mkdir -p "#{deploy_to}/shared/public"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/public"]
  queue! %[mkdir -p "#{deploy_to}/shared/vendor/assets/bower_components"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/vendor/assets/bower_components"]
end

desc "Deploys the current version to the staging server."
task :deploy => :enviroment do

  deploy do
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'disable_active_admin'
    invoke :'rails:db_migrate'
    invoke :'enable_active_admin'
    invoke :'bower_install'
    invoke :'assets_precompile'
    invoke :'deploy:cleanup'
    invoke :'restart_resque'

    to :launch do
      queue "mkdir -p #{deploy_to}/#{current_path}/tmp/"
      invoke :'puma:phased_restart'
    end
  end
  invoke :'whenever:write'
end

我删除了一些代码块,因为所以禁止传递大量的代码链。我的英文不好

1 个答案:

答案 0 :(得分:0)

@МалъСкрылевъ感谢您的回复,但我找到了解决方案。有它 https://github.com/mina-deploy/mina/issues/79