mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
7432c710b0
If an error is raised during a deploy, the task `deploy:failed` will be triggered. Custom tasks can hook into this using `after`: after 'deploy:failed', :send_for_help do # end I've also taken the opportunity to provide a marginally more useful error message before triggering the task. By default, this 'deploy:failed' will only be triggered when running `cap <stage> deploy` - to trigger after individual tasks use `set :deploying, true` This closes #708 and replaces https://github.com/capistrano/capistrano/pull/720
17 lines
513 B
Gherkin
17 lines
513 B
Gherkin
Feature: Deploy failure
|
|
|
|
Background:
|
|
Given a test app with the default configuration
|
|
And a custom task that will simulate a failure
|
|
And a custom task to run in the event of a failure
|
|
And servers with the roles app and web
|
|
|
|
Scenario: Triggering the custom task
|
|
When I run cap "deploy:starting"
|
|
But an error is raised
|
|
Then the failure task will not run
|
|
|
|
Scenario: Triggering the custom task
|
|
When I run cap "deploy"
|
|
But an error is raised
|
|
Then the failure task will run
|