' . $environmentName . '');
// Check if there is already an environment with the same name
if (file_exists($environmentConfigFile)) {
Mage_Console::output('Error!! Already exists an environment called ' . $environmentName . '', 1, 2);
} else {
$baseConfig = '#' . $environmentName . PHP_EOL
. 'user: dummy' . PHP_EOL
. 'deploy-from: ./' . PHP_EOL
. 'deploy-to: /var/www/vhosts/example.com/www' . PHP_EOL
. 'hosts:' . PHP_EOL
. 'pre-tasks:' . PHP_EOL
. 'tasks:' . PHP_EOL
. ' - deployment/rsync' . PHP_EOL
. 'post-tasks:' . PHP_EOL;
$result = file_put_contents($environmentConfigFile, $baseConfig);
if ($result) {
Mage_Console::output('Success!! Environment config file for ' . $environmentName . ' created successfully at ' . $environmentConfigFile . '');
Mage_Console::output('So please! Review and adjust its configuration.', 2, 2);
} else {
Mage_Console::output('Error!! Unable to create config file for environment called ' . $environmentName . '', 1, 2);
}
}
}
}