Deployer: Asking for confirmation before proceeding with deployment

Created on 31 Aug 2016  路  4Comments  路  Source: deployphp/deployer

| Q | A |
| --- | --- |
| Issue Type | Question |
| Deployer Version | 3.3.0 |
| Local Machine OS | macOS El Capitan |
| Remote Machine OS | Ubuntu 14.04 |

Question

As an additional control mechanism I'd like to add an additional step to my deployment that displays a message and asks for confirmation.

In one of my projects I have a certain prerequisit to be met in order for the deployment to succeed. I'd like to display a message 谩 la "Did you make sure to do XYZ (yes|no)" and only proceed with deployment if "yes" is entered.

Is there a way to achieve this?

Most helpful comment

Something like this:

task('ask', function() {
    if(!askConfirmation('Deploy app?')) {
        die('Ok, no deploy then.');
    }
});

before('deploy', 'ask');

All 4 comments

Try use this:

askConfirmation(string $message[, bool $default = false])

Could you give code example, I'm having hard time figuring out how to ask for confirmation AND if user answers no -> cancel deploy.

Something like this:

task('ask', function() {
    if(!askConfirmation('Deploy app?')) {
        die('Ok, no deploy then.');
    }
});

before('deploy', 'ask');

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

greatwitenorth picture greatwitenorth  路  4Comments

exts picture exts  路  3Comments

k-solnushkin picture k-solnushkin  路  5Comments

timkley picture timkley  路  4Comments

minkbear picture minkbear  路  4Comments