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

launch block don't works #170

Closed
edipofederle opened this issue Mar 8, 2014 · 9 comments
Closed

launch block don't works #170

edipofederle opened this issue Mar 8, 2014 · 9 comments

Comments

@edipofederle
Copy link

Hi,

I using mina for a good time from now, but still can not make it work for complete. The :launch block don't works, in order to restart my app after deploy. I am using something like this:

task deploy: :environment do
  deploy do
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'
    invoke :'rails:assets_precompile:force'
  end

  to :launch do
    queue "touch #{deploy_to}/tmp/restart.txt"
  end
end

Thanks

@hugomarisco
Copy link

+1

@edipofederle
Copy link
Author

@hugomarisco try it: https://github.com/tomafro/recap. I never liked capistrano, but recap is really nice and works very well.

@hernanvicente
Copy link

+1 Same problem here

@hernanvicente
Copy link

I have to run touch tmp/restart.txt not from the :deploy_to directory but from the current/ directory.

I left here my deploy.rb

task :deploy => :environment do
  deploy do
    # Put things that will set up an empty directory into a fully set-up
    # instance of your project.
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'
    invoke :'rails:assets_precompile'

    to :launch do
      queue! %[mkdir -p "#{deploy_to}/current/tmp"] # Create the tmp/ directory inside current
      queue "touch #{deploy_to}/current/tmp/restart.txt" # Add current to this path
    end
  end
end

Thanks!

@edipofederle
Copy link
Author

@hernanvicente I will try it.

UPDATE: Sorry, but I already tried and did not work well.

Thanks

@reicheltd
Copy link

+1 same issue

@beirigo
Copy link
Contributor

beirigo commented Apr 11, 2014

I have something like this:

task :restart => :environment do
  pidfile = "#{deploy_to}/current/tmp/pids/unicorn.pid"
  queue "if [ -f #{pidfile} ]; then kill -s USR2 `cat #{pidfile}`;fi"
end

Invoking it from the launch block works just fine. deploy_to does not point to the current deployed folder of your project, Try appending /current to the path.

@fertobar
Copy link

Hi this task works for me:

 ...  
deploy do
    queue %[ruby -e "\\$stderr.write \\\"This is stdout output\n\\\""]
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'

    to :launch do
      invoke :'passenger:restart'
    end
  end
end

desc "Restarts the passenger server."
task :restart do
  invoke :'passenger:restart'
end

namespace :passenger do
  task :restart do
    queue %{
      echo "-----> Restarting passenger"
      #{echo_cmd %[mkdir -p tmp]}
      #{echo_cmd %[touch tmp/restart.txt]}
    }
  end
end

from https://github.com/nadarei/mina/blob/master/test_env/config/deploy.rb

@gabskoro
Copy link
Member

gabskoro commented Oct 4, 2014

This is fixed, we just added

queue "mkdir -p #{deploy_to}/#{current_path}/tmp/" 

before touching the restart.txt file.

@gabskoro gabskoro closed this as completed Oct 4, 2014
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

7 participants