mina-deploy / mina

Blazing fast deployer and server automation tool
https://rubygems.org/gems/mina
Other
4.35k stars 490 forks source link

Execution mode / Don't know how to build task #508

Closed airled closed 7 years ago

airled commented 7 years ago

Hi. New version of mina is really confusing. Setup and deploy both raise exception. Mina v.1.0.6 Barely changed default deploy.rb:

require 'mina/bundler'
require 'mina/git'
require 'mina/rbenv'

set :application_name, '...'
set :domain,           '...'
set :deploy_to,        '...'
set :repository,       '...'
set :branch,           'master'
set :shared_dirs,      fetch(:shared_dirs, []).push('tmp', 'log')
set :shared_files,     fetch(:shared_files, []).push('config/database.yml')

task :environment do
  invoke :'rbenv:load'
end

task setup: :environment do
end

desc "Deploys the current version to the server."
task deploy: :environment do
  deploy do
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'deploy:cleanup'

    on :launch do
      in_path(fetch(:current_path)) do
        command %{mkdir -p tmp/}
        command %{touch tmp/restart.txt}
      end
    end
  end

end

On 'mina setup':

mina aborted!
You must specify execution mode

On 'mina deploy':

mina aborted!
Don't know how to build task 'deploy:link_shared_paths' (see --tasks)

What am i doing wrong?

Some updates. I read some other issues and tried to remove ':environment' dependency for the tasks. Setup now does nothing (I expect it at least create some default directories on server) but deploy raises same exception.

coreyworrell commented 7 years ago

I had to add require 'mina/deploy' to the top of the file and then it seemed to work fine after that. Not sure if that's something new that is required and undocumented, or if our env isn't what mina expects.

airled commented 7 years ago

@coreyworrell Yes. It worked for me. Thank you so much.