How to define and run capistrano 3 task after deploy?

Jorge de los Santos

I have a capistrano script that works perfect, except it's not running a task after the deploy. I'm using rails_daemons to launch the rails application and a I need to restart the daemons.

#deploy.rb

namespace :deploy do
  on roles :all do
    execute :bundle, "exec rake daemons:restart"
  end
end

Tryed this also:

task :restart_daemons, :roles => :app do
  execute :bundle, "exec rake daemons:restart"
end

after "deploy", "deploy:restart_daemons" 
davids

First off, have you checked if bundle exec rake daemons:restart works locally? If so, try something like this:

namespace :deploy do

  after :restart do
    on roles(:web), in: :groups, limit: 3, wait: 10 do
      within release_path do
         execute :rake, 'daemons:restart'
      end
    end
  end

end

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

capistrano 3 Don't know how to build task 'deploy:updated'

From Dev

How to halt a Capistrano deploy from within a task

From Dev

Capistrano 3 does not restart after deploy

From Dev

capistrano3: Don't know how to build task 'deploy:create_db'

From Dev

How to run a capistrano task on server start?

From Dev

Running task before deploy:symlink:shared capistrano 3

From Dev

How to deploy a specific revision with capistrano 3

From Dev

Capistrano v3 - Hook to run command post deploy

From Dev

Capistrano v3 - Hook to run command post deploy

From Dev

Capistrano 3: After deployment is not "refreshed" code (website stays as prior the deploy)

From Dev

Prevent capistrano to run migration in deploy

From Dev

How to deploy rails sqlite3 database with capistrano

From Dev

'Don't know how to build task' error in Capistrano 3

From Dev

Assets link to wrong release after Capistrano deploy

From Dev

Rails assets missing after Capistrano deploy

From Dev

Assets link to wrong release after Capistrano deploy

From Dev

Unable to deploy through capistrano after ubuntu upgrade

From Dev

How to run rvmrc trust command using Capistrano 3

From Java

How to run shell commands on server in Capistrano v3?

From Dev

Update codebasehq.com on deploy with Capistrano 3

From Dev

Capistrano 3 Before and After Hooks

From Dev

How do you deploy to only one server with Capistrano v3?

From Dev

Rails 4, Capistrano 3 and Dotenv - How to deploy using server-side .env file

From Dev

How set environment variable on capistrano deploy?

From Dev

How to access environment variables during Capistrano deploy?

From Dev

How set environment variable on capistrano deploy?

From Dev

Linkedin parseq. How to run task after task?

From Dev

How to plan a task to run after another already running task in bash?

From Dev

Capistrano 3 "upload" task raises error

Related Related

  1. 1

    capistrano 3 Don't know how to build task 'deploy:updated'

  2. 2

    How to halt a Capistrano deploy from within a task

  3. 3

    Capistrano 3 does not restart after deploy

  4. 4

    capistrano3: Don't know how to build task 'deploy:create_db'

  5. 5

    How to run a capistrano task on server start?

  6. 6

    Running task before deploy:symlink:shared capistrano 3

  7. 7

    How to deploy a specific revision with capistrano 3

  8. 8

    Capistrano v3 - Hook to run command post deploy

  9. 9

    Capistrano v3 - Hook to run command post deploy

  10. 10

    Capistrano 3: After deployment is not "refreshed" code (website stays as prior the deploy)

  11. 11

    Prevent capistrano to run migration in deploy

  12. 12

    How to deploy rails sqlite3 database with capistrano

  13. 13

    'Don't know how to build task' error in Capistrano 3

  14. 14

    Assets link to wrong release after Capistrano deploy

  15. 15

    Rails assets missing after Capistrano deploy

  16. 16

    Assets link to wrong release after Capistrano deploy

  17. 17

    Unable to deploy through capistrano after ubuntu upgrade

  18. 18

    How to run rvmrc trust command using Capistrano 3

  19. 19

    How to run shell commands on server in Capistrano v3?

  20. 20

    Update codebasehq.com on deploy with Capistrano 3

  21. 21

    Capistrano 3 Before and After Hooks

  22. 22

    How do you deploy to only one server with Capistrano v3?

  23. 23

    Rails 4, Capistrano 3 and Dotenv - How to deploy using server-side .env file

  24. 24

    How set environment variable on capistrano deploy?

  25. 25

    How to access environment variables during Capistrano deploy?

  26. 26

    How set environment variable on capistrano deploy?

  27. 27

    Linkedin parseq. How to run task after task?

  28. 28

    How to plan a task to run after another already running task in bash?

  29. 29

    Capistrano 3 "upload" task raises error

HotTag

Archive