Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy does not work since version 1.2.0 #572

Closed
ozgg opened this issue Sep 29, 2017 · 6 comments
Closed

Deploy does not work since version 1.2.0 #572

ozgg opened this issue Sep 29, 2017 · 6 comments

Comments

@ozgg
Copy link
Contributor

ozgg commented Sep 29, 2017

I've updated bundle to 1.2.0 and since then if I try to run mina deploy, I get the following error without any additional information:

 !     Can't be run outside deploy do block. Please use mina 'rake[db_migrate]' instead

Creating new config with mina init does not help. So I had to roll back to previous version.

@d4be4st
Copy link
Member

d4be4st commented Sep 29, 2017

I have added a couple of guards to discourage wrong use.
Can I take a lookt at your deploy.rb? At least your deploy task?

@ozgg
Copy link
Contributor Author

ozgg commented Sep 29, 2017

I doesn't differ much from one that is generated with mina init, only in settings such as user/host:

require 'mina/rails'
require 'mina/git'
require 'mina/rbenv'  # for rbenv support. (https://rbenv.org)

set :application_name, 'paradox'
set :domain, 'paradox-life.ru'
set :deploy_to, '/var/www/paradox-life.ru'
set :repository, '...'
set :branch, 'master'

set :user, 'developer'          # Username in the server to SSH to.

set :shared_dirs, fetch(:shared_dirs, []).push('tmp', 'log', 'public/uploads', 'public/ckeditor')
set :shared_files, fetch(:shared_files, []).push('.env')

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

task :setup do
end

desc "Deploys the current version to the server."
task :deploy do
  deploy do
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'
    invoke :'rails:assets_precompile'
    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

(I've removed comments for brevity).

@d4be4st d4be4st closed this as completed in fdf91d3 Oct 2, 2017
@d4be4st
Copy link
Member

d4be4st commented Oct 2, 2017

Gah, had a typo!

Thank you!

Released v1.2.1 with a fix

@ozgg
Copy link
Contributor Author

ozgg commented Oct 2, 2017

Now it fails with another error :)

-----> Creating a temporary build path
-----> Fetching new git commits
-----> Using git branch 'master'
       Cloning into '.'...
       done.
-----> Using this git commit
       Maxim Khan-Magomedov (dbb0d30):
       > Масштабирование картинки для курсов в шапке
-----> Symlinking shared paths
-----> Installing gem dependencies using Bundler
       bash: line 86: bundle: command not found
 !     ERROR: Deploy failed.
-----> Cleaning up build
       Unlinking current
       OK
       Connection to paradox-life.ru closed.

 !     Run Error

Is it somehow connected with environment block?

@ozgg
Copy link
Contributor Author

ozgg commented Oct 2, 2017

I changed task :environment to task :remote_environment in deploy.rb and it worked.

@ccfiel
Copy link

ccfiel commented Oct 12, 2017

@ozgg thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants