mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-26 09:10:05 +02:00
added simple confirm-environment task to help prevent accidental deploys to productions
This commit is contained in:
parent
0cd94285de
commit
48484793ac
32
Mage/Task/Newcraft/Communication/ConfirmEnvironmentTask.php
Normal file
32
Mage/Task/Newcraft/Communication/ConfirmEnvironmentTask.php
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Mage\Task\Newcraft\Communication;
|
||||||
|
|
||||||
|
use Mage\Task\AbstractTask;
|
||||||
|
use Mage\Console;
|
||||||
|
|
||||||
|
class ConfirmEnvironmentTask extends AbstractTask
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Returns the Title of the Task
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return 'Confirm environment [newcraft]';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs the task
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
Console::output('');
|
||||||
|
Console::output('Deploying to <white>'.$this->getConfig()->getEnvironment().'</white>! Sure? (Y/N)... ', 3, 0);
|
||||||
|
$answer = strtoupper(Console::readInput());
|
||||||
|
Console::output('Cont... <purple>'.$this->getName().'</purple> ... ', 2, 0);
|
||||||
|
return 'Y' === $answer;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue