Skip to content

How to do a proper finish hook? #425

Description

@devvmh

Related to #424, the code I provided there doesn't do what I'd like. Given these two tasks

namespace :notification do
  notifier = Slack::Notifier.new('https://hook.bearychat.com/=bw6KQ/incoming/2d9481657d9013eb61cb41d3708f39a8')
  task :start_deploy do
    notifier.ping %(mina 1.x test - start deploy task ran)
    command %(echo 'started')
  end

  task :finish_deploy do
    notifier.ping %(mina 1.x test - finish deploy task ran)
    command %(echo 'finished')
  end
end

I get this output:

       started
       Elapsed time: 0.00 seconds
       finished
       Elapsed time: 0.00 seconds
-----> Creating a temporary build path
-----> Deploy finished
-----> Building
-----> Moving build to /home/deploy/mina-deploys/minatest/cure/releases/20160815063411
-----> Build finished
-----> Launching
-----> Updating the /home/deploy/mina-deploys/minatest/cure/current symlink
-----> Done. Deployed version 20160815063411
       Elapsed time: 1.47 seconds

What I would like is for the finish_deploy output (and slack notification) to run after passenger is restarted, like so:

       started
       Elapsed time: 0.00 seconds
-----> Creating a temporary build path
-----> Deploy finished
-----> Building
-----> Moving build to /home/deploy/mina-deploys/minatest/cure/releases/20160815063411
-----> Build finished
-----> Launching
-----> Updating the /home/deploy/mina-deploys/minatest/cure/current symlink
-----> Done. Deployed version 20160815063411
       Elapsed time: 1.47 seconds
       finished
       Elapsed time: 0.00 seconds

Is there a way to make mina do what I want?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions