mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-22 16:27:39 +01:00
Allow to start Deployer console app if there are no deploy.php file.
This commit is contained in:
parent
c92a022053
commit
6a673a7bd2
36
bin/dep
36
bin/dep
@ -27,28 +27,26 @@ if (!$loaded) {
|
||||
// Recipe include path
|
||||
set_include_path(__DIR__ . '/../');
|
||||
|
||||
// Init Deployer
|
||||
$deployer = new \Deployer\Deployer(
|
||||
new \Symfony\Component\Console\Application('Deployer', '__VERSION__'),
|
||||
new \Symfony\Component\Console\Input\ArgvInput(),
|
||||
new \Symfony\Component\Console\Output\ConsoleOutput()
|
||||
);
|
||||
|
||||
// Require current deploy.php script
|
||||
$deployFile = getcwd() . '/deploy.php';
|
||||
|
||||
if (is_file($deployFile) && is_readable($deployFile)) {
|
||||
// Init Deployer
|
||||
$deployer = new \Deployer\Deployer(
|
||||
new \Symfony\Component\Console\Application('Deployer', '__VERSION__'),
|
||||
new \Symfony\Component\Console\Input\ArgvInput(),
|
||||
new \Symfony\Component\Console\Output\ConsoleOutput()
|
||||
);
|
||||
|
||||
// Require current deploy.php script
|
||||
require $deployFile;
|
||||
}
|
||||
|
||||
// Self-update command
|
||||
$selfUpdate = new \KevinGH\Amend\Command('self-update');
|
||||
$selfUpdate->setDescription('Updates deployer.phar to the latest version');
|
||||
$selfUpdate->setManifestUri('https://raw.github.com/elfet/deployer/master/manifest.json');
|
||||
$deployer->getConsole()->add($selfUpdate);
|
||||
$deployer->getHelperSet()->set(new \KevinGH\Amend\Helper());
|
||||
// Self-update command
|
||||
$selfUpdate = new \KevinGH\Amend\Command('self-update');
|
||||
$selfUpdate->setDescription('Updates deployer.phar to the latest version');
|
||||
$selfUpdate->setManifestUri('https://raw.github.com/elfet/deployer/master/manifest.json');
|
||||
$deployer->getConsole()->add($selfUpdate);
|
||||
$deployer->getHelperSet()->set(new \KevinGH\Amend\Helper());
|
||||
|
||||
// Run Deployer
|
||||
$deployer->run();
|
||||
} else {
|
||||
echo "deploy.php file does not found.\n";
|
||||
}
|
||||
// Run Deployer
|
||||
$deployer->run();
|
||||
|
Loading…
x
Reference in New Issue
Block a user